Skip to content

fix(otel): use stable deployment environment resource key - #20847

Draft
mabdinur wants to merge 1 commit into
mainfrom
codex/otel-deployment-environment-name
Draft

mabdinur wants to merge 1 commit into
mainfrom
codex/otel-deployment-environment-name

Conversation

@mabdinur

@mabdinur mabdinur commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Description

Maps DD_ENV-derived OTLP log and metric resource environments to the stable deployment.environment.name attribute. Input remapping is unchanged, so deprecated deployment.environment input remains supported and the stable key keeps precedence.

References OTEL-3337.
Companion system tests: DataDog/system-tests#7973.

Testing

  • 6 focused OpenTelemetry tests passed on Python 3.13 / OpenTelemetry 1.34
  • scripts/lint checks

Risks

Low. The change is limited to synthesized OTLP resource attribute names.

Additional Notes

Draft while the cross-SDK rollout and system-test validation complete.

@mabdinur mabdinur added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Oct 7, 2026
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against main using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

ddtrace/internal/opentelemetry/logs.py                                  @DataDog/apm-sdk-capabilities-python
ddtrace/internal/opentelemetry/metrics.py                               @DataDog/apm-sdk-capabilities-python
releasenotes/notes/fix-otel-resource-environment-name-28fd4f1541e0d8ed.yaml  @DataDog/apm-python
tests/opentelemetry/test_logs.py                                        @DataDog/apm-sdk-capabilities-python
tests/opentelemetry/test_metrics.py                                     @DataDog/apm-sdk-capabilities-python

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 201 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 201 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=132)
ddtrace.llmobs._integrations.base -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)
ddtrace.llmobs._integrations.claude_agent_sdk -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)
ddtrace.llmobs._integrations.litellm -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=130)
ddtrace.internal.opentelemetry.trace -×-> ddtrace.trace  (product:opentelemetry -> product:tracing, score=130)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 1 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Tests

✅ All CI checks and tests passed.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@pr-commenter

pr-commenter Bot commented Oct 7, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-10-07 04:24:02

Comparing candidate commit 6f064e1 in PR branch codex/otel-deployment-environment-name with baseline commit 049682f in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 42 metrics, 0 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 ----------------------------------'

scenario:otelspan-start

  • 🟥 execution_time [+1.872ms; +2.469ms] or [+7.617%; +10.046%]

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant