fix(sidecar): don't double-encode file:// telemetry endpoints - #2230
Conversation
The per-session self-telemetry setup stringified an already-parsed session endpoint URI and passed it to telemetry Config::set_endpoint. For file:// endpoints, parse_uri then encoded the URI authority a second time, causing the telemetry file client to open the wrong path and tear down telemetry. Preserve the telemetry-owned TelemetryEndpoint configuration API introduced by #2152. Add Config::set_endpoint_uri for integrations that already hold an http::Uri, and use it from the sidecar and crashtracker so parsed endpoints are never stringified and reparsed. String and FFI callers continue to use the primitive patch API and parse their original URL exactly once. Document that parse_uri is not idempotent for file, unix, and windows schemes, and add regression coverage for passing a parsed file URI without re-encoding its path.
|
This fixes a regression introduced by commit |
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality. |
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: b113705 | Docs | Datadog PR Page | Give us feedback! |
BenchmarksComparisonBenchmark execution time: 2026-07-12 15:23:46 Comparing candidate commit b113705 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 123 metrics, 0 unstable metrics.
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
bwoebi
left a comment
There was a problem hiding this comment.
Ugly workaround, but makes sense.
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
What changed
Config::set_endpoint_urifor integrations that already hold a parsed URI.TelemetryEndpointprimitive configuration API.parse_urifor file, Unix socket, and Windows pipe schemes.file://endpoints.Why
Sidecar session setup converted an already-parsed endpoint URI back to a string and passed it through
parse_uriagain. Forfile://endpoints, the path is encoded into the URI authority, so parsing the string representation a second time encoded the authority again. Telemetry then opened the wrong file path and the worker failure tore down the sidecar IPC connection.The fix gives parsed-URI callers an explicit path while keeping the public configuration boundary introduced for telemetry consumers.
Validation
cargo check -p libdd-telemetry -p libdd-crashtracker -p datadog-sidecarcargo test -p libdd-telemetry config::tests::test_config_set_parsed_file_uri_does_not_reencode_path -- --exactorigin/main.