Skip to content

Add stable OTel environment attribute mapping - #6261

Merged
bm1549 merged 8 commits into
masterfrom
brian.marks/otel-deployment-environment-name
Sep 30, 2026
Merged

bm1549 merged 8 commits into
masterfrom
brian.marks/otel-deployment-environment-name

Conversation

@bm1549

@bm1549 bm1549 commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Maps deployment.environment.name from OTEL_RESOURCE_ATTRIBUTES to the Datadog environment. The stable attribute takes precedence over the legacy deployment.environment fallback, and DD_ENV still wins.

OpenTelemetry Logs and Metrics emit the resolved environment as deployment.environment.name and no longer emit deployment.environment.

The shared signal configuration declares its settings type and explicitly selects Logs or Metrics settings, removing its steep:ignore suppressions.

Motivation:

OpenTelemetry stabilized the deployment environment semantic convention under deployment.environment.name.

Related PRs:

Change log entry

Yes. unreleased/20260930140422.json records 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?

  • Ruby 2.5 and 4.0: 9 focused deployment environment settings examples, 0 failures
  • Ruby 2.6: full OpenTelemetry task, 254 examples, 0 failures, 65 pending for unsupported signals
  • Ruby 4.0: full OpenTelemetry task, 254 examples, 0 failures
  • Changelog schema, Vale, and rendered-output checks
  • StandardRB and RuboCop, 1,994 files inspected with no offenses
  • Steep, no type errors

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 0.00%
• Overall Coverage: 90.54% (-0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 82a7190 | Docs | View more details | Give us feedback!

@bm1549
bm1549 marked this pull request as ready for review September 1, 2026 22:50
@bm1549
bm1549 requested a review from a team as a code owner September 1, 2026 22:50
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-01T22:54:10.382405Z 0759282 Draft marked ready
🔒 Security Review ✅ Completed 2026-09-01T22:53:42.563641Z 0759282 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread lib/datadog/core/configuration/settings.rb Outdated
@bm1549
bm1549 requested a review from a team as a code owner September 10, 2026 15:37
@bm1549
bm1549 requested a review from vpellan September 10, 2026 15:37
@dd-octo-sts dd-octo-sts Bot added the otel OpenTelemetry-related changes label Sep 10, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Typing analysis

Note: Ignored files are excluded from the next sections.

steep:ignore comments

This PR clears 8 steep:ignore comments.

steep:ignore comments (+0-8) ✅ Cleared:
lib/datadog/opentelemetry/signal_configuration.rb:15
lib/datadog/opentelemetry/signal_configuration.rb:25
lib/datadog/opentelemetry/signal_configuration.rb:26
lib/datadog/opentelemetry/signal_configuration.rb:27
lib/datadog/opentelemetry/signal_configuration.rb:29
lib/datadog/opentelemetry/signal_configuration.rb:31
lib/datadog/opentelemetry/signal_configuration.rb:44
lib/datadog/opentelemetry/signal_configuration.rb:46

@pr-commenter

pr-commenter Bot commented Sep 10, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-10 16:04:36

Comparing candidate commit b9a3a6a in PR branch brian.marks/otel-deployment-environment-name with baseline commit c067392 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 48 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:tracing - Tracing.continue_trace!

  • unstable throughput [-2131.009op/s; +1738.402op/s] or [-5.517%; +4.501%]

@bm1549
bm1549 requested a review from Strech September 10, 2026 17:59
Comment thread lib/datadog/core/configuration/settings.rb Outdated
Comment thread sig/datadog/opentelemetry/configuration/settings.rbs Outdated
Comment thread lib/datadog/opentelemetry/signal_configuration.rb Outdated
zacharycmontoya added a commit to DataDog/dd-trace-dotnet that referenced this pull request Sep 18, 2026
## 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>

@vpellan vpellan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after applying the suggestions left by @y9v

@bm1549
bm1549 merged commit 3ffe5d6 into master Sep 30, 2026
614 checks passed
@bm1549
bm1549 deleted the brian.marks/otel-deployment-environment-name branch September 30, 2026 17:49
@dd-octo-sts dd-octo-sts Bot added this to the 2.44.0 milestone Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos core Involves Datadog core libraries otel OpenTelemetry-related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants