feat(envoyproxy/serviceextensions): add Unix domain socket support#4463
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-04-08 10:07:55 Comparing candidate commit 0cad2cc in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 216 metrics, 8 unstable metrics.
|
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
devflow unqueued this merge request: It did not become mergeable within the expected time |
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 0cad2cc | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
0647a2c to
30d2b5b
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
Tests failed on this commit 4cb8626: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit 30b3613:
What to do next?
|
Signed-off-by: Eliott Bouhana <[email protected]>
Set default to null for DD_TRACE_HEADER_TAGS implementation A and add trailing newline.
30d2b5b to
0cad2cc
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Tests failed on this commit 7e8a514:
What to do next?
|
…4463) ### What does this PR do? Adds support for Unix domain socket (UDS) as an alternative transport for the gRPC callout server in the ASM Service Extension. When `DD_SERVICE_EXTENSION_UDS_PATH` is set, the server binds to the specified socket path instead of listening on a TCP `host:port`. ### Motivation When running the Service Extension alongside a self-managed Envoy on the same host, a Unix domain socket avoids the need for TLS and reduces network overhead compared to a loopback TCP connection. This is useful for local Envoy deployments that are not operated through GCP Service Extensions. ### Changes - Add `extensionSocketPath string` field to `serviceExtensionConfig` - Read `DD_SERVICE_EXTENSION_UDS_PATH` env var in `loadConfig` (empty = TCP mode, no change to existing behaviour) - In `startGPRCSsl`: use `net.Listen("unix", path)` when socket path is set; warn and skip TLS in UDS mode; defer socket file cleanup to cover all exit paths (clean shutdown and `Serve` errors); log a warning for unexpected errors when removing stale socket files before bind - Register `DD_SERVICE_EXTENSION_UDS_PATH` in `internal/env/supported_configurations.json` and regenerate `supported_configurations.gen.go` - Fix pre-existing test isolation bug: `allKeys` had wrong TLS env var names (`_CERT`/`_KEY` instead of `_CERT_FILE`/`_KEY_FILE`) - Document the new env var in `README.md` with an Envoy YAML config example ### Reviewer's Checklist - [x] Changed code has unit tests for its functionality at or near 100% coverage. - [ ] [System-Tests](https://github.com/DataDog/system-tests/) covering this feature have been added and enabled with the va.b.c-dev version tag. - [ ] There is a benchmark for any new code, or changes to existing code. - [ ] If this interacts with the agent in a new way, a system test has been added. - [x] New code is free of linting errors. You can check this by running `make lint` locally. - [x] New code doesn't break existing tests. You can check this by running `make test` locally. - [ ] Add an appropriate team label so this PR gets put in the right place for the release notes. - [x] All generated files are up to date. You can check this by running `make generate` locally. - [ ] Non-trivial go.mod changes, e.g. adding new modules, are reviewed by @DataDog/dd-trace-go-guild. Make sure all nested modules are up to date by running `make fix-modules` locally.
What does this PR do?
Adds support for Unix domain socket (UDS) as an alternative transport for the gRPC callout server in the ASM Service Extension. When
DD_SERVICE_EXTENSION_UDS_PATHis set, the server binds to the specified socket path instead of listening on a TCPhost:port.Motivation
When running the Service Extension alongside a self-managed Envoy on the same host, a Unix domain socket avoids the need for TLS and reduces network overhead compared to a loopback TCP connection. This is useful for local Envoy deployments that are not operated through GCP Service Extensions.
Changes
extensionSocketPath stringfield toserviceExtensionConfigDD_SERVICE_EXTENSION_UDS_PATHenv var inloadConfig(empty = TCP mode, no change to existing behaviour)startGPRCSsl: usenet.Listen("unix", path)when socket path is set; warn and skip TLS in UDS mode; defer socket file cleanup to cover all exit paths (clean shutdown andServeerrors); log a warning for unexpected errors when removing stale socket files before bindDD_SERVICE_EXTENSION_UDS_PATHininternal/env/supported_configurations.jsonand regeneratesupported_configurations.gen.goallKeyshad wrong TLS env var names (_CERT/_KEYinstead of_CERT_FILE/_KEY_FILE)README.mdwith an Envoy YAML config exampleReviewer's Checklist
make lintlocally.make testlocally.make generatelocally.make fix-moduleslocally.