Add stable OTel environment attribute mapping - #6261
Conversation
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 82a7190 | Docs | View more details | Give us feedback! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 07592829bb
ℹ️ 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".
Typing analysisNote: Ignored files are excluded from the next sections.
|
…ployment-environment-name
BenchmarksBenchmark execution time: 2026-09-10 16:04:36 Comparing candidate commit b9a3a6a in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.
|
## Summary of changes Map `deployment.environment.name` to the Datadog environment. Keep `deployment.environment` as a fallback, and keep `DD_ENV` as the highest-precedence source. ## Reason for change OpenTelemetry stabilized the deployment environment semantic convention under `deployment.environment.name`. Related PRs: - DataDog/system-tests#7613 - DataDog/dd-trace-go#5285 - #9150 - DataDog/dd-trace-rb#6261 - DataDog/dd-trace-php#4148 - DataDog/dd-trace-js#10050 - DataDog/dd-trace-rs#300 - DataDog/dd-trace-java#12324 - DataDog/dd-trace-py#19901 ## Implementation details The resource attribute mapper tracks the stable and legacy values separately, then chooses the stable value regardless of input order. It removes both source aliases after promotion and leaves unrelated attributes alone. ## Test coverage Five focused mapping cases and 182 adjacent configuration tests passed locally. Formatting checks also passed. ## Other details None. --------- Co-authored-by: Zach Montoya <zach.montoya@datadoghq.com>
What does this PR do?
Maps
deployment.environment.namefromOTEL_RESOURCE_ATTRIBUTESto the Datadog environment. The stable attribute takes precedence over the legacydeployment.environmentfallback, andDD_ENVstill wins.OpenTelemetry Logs and Metrics emit the resolved environment as
deployment.environment.nameand no longer emitdeployment.environment.The shared signal configuration declares its settings type and explicitly selects Logs or Metrics settings, removing its
steep:ignoresuppressions.Motivation:
OpenTelemetry stabilized the deployment environment semantic convention under
deployment.environment.name.Related PRs:
Change log entry
Yes.
unreleased/20260930140422.jsonrecords the Logs and Metrics output-key change and the legacy input fallback.Additional Notes:
I read and checked the AI-assisted changes.
How to test the change?