Skip to content

feat(config): add a new propagation_as_span_links configuration - #19858

Open
dubloom wants to merge 3 commits into
mainfrom
dubloom/propagation-as-span-links
Open

feat(config): add a new propagation_as_span_links configuration#19858
dubloom wants to merge 3 commits into
mainfrom
dubloom/propagation-as-span-links

Conversation

@dubloom

@dubloom dubloom commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

This PR: #18667 is changing the way we propagate context in kafka library by using span links instead of parent-child relationship.

We can't do that directly because we would break existing semantics. Therefore we are going to gate that change under a config. google pub sub was doing something similar therefore we will aggregate the configuration and create one that deal with both instead of a specific config every time.

@datadog-datadog-us1-prod

datadog-datadog-us1-prod Bot commented Aug 25, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 6 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-py | build linux serverless: [amd64, cp315-cp315, v113741238-d2b8243-manylinux2014_x86_64, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | build linux serverless: [arm64, cp315-cp315, v113741357-d2b8243-manylinux2014_aarch64, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | validate_supported_configurations_v2_local_file — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 6 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

Useful? React with 👍 / 👎

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

@brettlangdon brettlangdon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm

@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: ec1d9b7e96

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread ddtrace/contrib/internal/google_cloud_pubsub/utils.py Outdated
Comment thread docs/configuration.rst
Comment thread docs/configuration.rst Outdated
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 3 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
ddtrace.llmobs -> ddtrace.llmobs._evaluators -> ddtrace.llmobs._evaluators.format -> ddtrace.llmobs._experiment -> ddtrace.llmobs
ddtrace.appsec._asm_request_context -> ddtrace.appsec._iast._iast_request_context_base -> ddtrace.appsec._iast._iast_env -> ddtrace.appsec._iast.reporter -> ddtrace.appsec._exploit_prevention.stack_traces -> ddtrace.appsec._asm_request_context

@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

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

Show existing violations (showing 5 of 240 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=135)
ddtrace.llmobs._integrations.bedrock_agents -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)
ddtrace.internal.opentelemetry.trace -×-> ddtrace.trace  (product:opentelemetry -> product:tracing, score=133)
ddtrace.llmobs._integrations.anthropic -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)
ddtrace.llmobs._integrations.claude_agent_sdk -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)

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

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/contrib/internal/google_cloud_pubsub/__init__.py                @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/contrib/internal/google_cloud_pubsub/utils.py                   @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/internal/settings/_config.py                                    @DataDog/python-guild @DataDog/apm-sdk-capabilities-python
ddtrace/internal/settings/_supported_configurations.py                  @DataDog/apm-python
docs/configuration.rst                                                  @DataDog/python-guild
releasenotes/notes/trace-propagation-as-span-links-dd310dfe41bff13c.yaml  @DataDog/apm-python
supported-configurations.json                                           @DataDog/apm-python
tests/contrib/google_cloud_pubsub/test_pubsub.py                        @DataDog/apm-core-python @DataDog/apm-idm-python

@pr-commenter

pr-commenter Bot commented Aug 27, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-27 07:42:03

Comparing candidate commit 29e9545 in PR branch dubloom/propagation-as-span-links with baseline commit 3e13bc9 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 5 performance regressions! Performance is the same for 575 metrics, 10 unstable metrics, 2 known flaky benchmarks, 16 flaky benchmarks without significant changes.

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:httppropagationinject-ids_only

  • 🟥 execution_time [+2.282µs; +2.405µs] or [+13.707%; +14.452%]

scenario:iastaspects-title_aspect

  • 🟥 execution_time [+48.562µs; +53.855µs] or [+18.359%; +20.360%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+115.893µs; +121.238µs] or [+27.960%; +29.250%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+585.197ns; +623.628ns] or [+21.859%; +23.295%]

scenario:tracer-small

  • 🟥 execution_time [+30.780µs; +33.361µs] or [+9.263%; +10.039%]

Unstable benchmarks

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

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-713.192ns; +767.606ns] or [-6.449%; +6.941%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-29.523ns; +36.772ns] or [-4.873%; +6.069%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1726.300ns; +1582.831ns] or [-10.106%; +9.266%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1119.528ns; +1391.350ns] or [-8.645%; +10.744%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-323.148ns; +326.705ns] or [-8.850%; +8.947%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-256.008ns; +248.583ns] or [-8.838%; +8.582%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-78.834ns; +66.818ns] or [-6.577%; +5.574%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-4067.571ns; +4051.371ns] or [-9.797%; +9.758%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-735.833ns; +812.503ns] or [-9.019%; +9.959%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-58455.390ns; +58792.516ns] or [-9.402%; +9.457%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:iastaspects-casefold_noaspect

  • 🟥 execution_time [+40.040µs; +44.857µs] or [+15.775%; +17.673%]

scenario:span-start

  • 🟥 execution_time [+1.465ms; +1.711ms] or [+10.841%; +12.662%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_aspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants