feat(otlp): add instrumentation scope metadata#2235
Conversation
0600005 to
76a2c25
Compare
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 8cd68ab | Docs | Datadog PR Page | Give us feedback! |
BenchmarksComparisonBenchmark execution time: 2026-07-14 17:55:18 Comparing candidate commit 8cd68ab in PR branch Found 1 performance improvements and 0 performance regressions! Performance is the same for 138 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
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76a2c25992
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| language_version: String, | ||
| language_interpreter: String, | ||
| language_interpreter_vendor: String, | ||
| instrumentation_scope_name: String, |
There was a problem hiding this comment.
could you add test coverage for the new fields in the builder? You can probably just add them to test_new()
| otlp_instrumentation_scope_name: String, | ||
| otlp_instrumentation_scope_version: String, |
There was a problem hiding this comment.
These fields should live within otlp_config
Previously, OTLP trace export always emitted an empty instrumentation scope. Allow tracers to provide scope name and version through OTLP trace configuration, map those values into ScopeSpans, and expose the same configuration through the C FFI exporter.
76a2c25 to
8cd68ab
Compare
a7ec21d
into
main
What does this PR do?
Adds OTLP instrumentation scope metadata to the current trace exporter path.
The trace mapper now copies
instrumentation_scope_nameandinstrumentation_scope_versionfromOtlpResourceInfointoScopeSpans.scope.TraceExporterBuildergets a setter for OTLP trace scope metadata, stores those values inOtlpTraceConfig, and the exporter copies them into each OTLP traceOtlpResourceInfobefore mapping.The C FFI exporter config also exposes the same scope setter so non-Rust tracer callers can configure the scope when they enable OTLP export.
Motivation
dd-trace-jsnative OTLP trace export emittedscope: {}through@datadog/libdatadog@0.16.0. Its Platform OTLP integration test expects the Datadog tracer scope (name: dd-trace-js) and a tracer version.Additional Notes
This branch was ported from the old v37-based patch onto current
main; it is one commit ahead ofmainand no longer carries the release-line diff that made the earlier draft conflicting.DataDog/libdatadog-nodejs#173 currently pins this PR head (
8cd68ab922fb7aade0f089ccfc91291d874673af) only as a temporary unreleased dependency. Once libdatadog publishes an official release/tag containing this change, libdatadog-nodejs should move to that release/tag.How to test the change?
cargo +nightly-2026-02-08 fmt --all -- --checkcargo test -p libdd-trace-utils otlp_encoder::mapper --lib(26 pass)cargo test -p libdd-data-pipeline trace_exporter::builder::tests::test_new --lib(1 pass)cargo test -p libdd-data-pipeline-ffi config_otlp_instrumentation_scope_test --lib(2 pass)cargo check -p libdd-trace-utilscargo check -p libdd-data-pipelinecargo check -p libdd-data-pipeline-fficargo test -p libdd-data-pipeline-ffi trace_exporter --lib(28 pass)LibdatadogReviewFeedbackFixapproved with no findings