Skip to content

refactor(native): extract SPAN_LINK_FLAGS_PRESENT constant - #19929

Open
brettlangdon wants to merge 1 commit into
mainfrom
brettlangdon/span-link-flags-present-const
Open

refactor(native): extract SPAN_LINK_FLAGS_PRESENT constant#19929
brettlangdon wants to merge 1 commit into
mainfrom
brettlangdon/span-link-flags-present-const

Conversation

@brettlangdon

Copy link
Copy Markdown
Member

Description

Replace the repeated 0x8000_0000 magic number with a named constant so span_data.rs and span_link.rs share one definition of the flags-present bit.

Testing

Risks

Additional Notes

Replace the repeated 0x8000_0000 magic number with a named constant so
span_data.rs and span_link.rs share one definition of the flags-present bit.
@brettlangdon
brettlangdon requested a review from a team as a code owner August 28, 2026 14:51
@brettlangdon brettlangdon added the changelog/no-changelog A changelog entry is not required for this PR. label Aug 28, 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.

src/native/span/span_data.rs                                            @DataDog/apm-core-python
src/native/span/span_link.rs                                            @DataDog/apm-core-python

@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.internal.ci_visibility.api._base -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=133)
ddtrace.llmobs._integrations.langchain -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=133)
ddtrace.internal.test_visibility.api -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=133)
ddtrace.internal.ci_visibility.recorder -×-> ddtrace.trace  (product:ci_visibility -> 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

@pr-commenter

pr-commenter Bot commented Aug 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-28 15:26:35

Comparing candidate commit a364db4 in PR branch brettlangdon/span-link-flags-present-const with baseline commit c9856f2 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 7 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.574µs; +2.741µs] or [+15.553%; +16.563%]

scenario:iastaspects-add_aspect

  • 🟥 execution_time [+11.621µs; +13.521µs] or [+11.828%; +13.761%]

scenario:iastaspects-strip_aspect

  • 🟥 execution_time [+80.642µs; +87.375µs] or [+28.375%; +30.745%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+143.010µs; +148.825µs] or [+36.825%; +38.323%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+38.740µs; +45.295µs] or [+27.412%; +32.051%]

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

  • 🟥 execution_time [+642.471ns; +688.616ns] or [+23.845%; +25.557%]

scenario:tracer-small

  • 🟥 execution_time [+26.304µs; +29.104µs] or [+7.801%; +8.632%]

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 [-645.535ns; +806.299ns] or [-5.922%; +7.397%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-34.528ns; +31.209ns] or [-5.642%; +5.099%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1413.741ns; +1864.013ns] or [-8.416%; +11.097%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-695.151ns; +1833.109ns] or [-5.413%; +14.274%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-262.165ns; +383.348ns] or [-7.250%; +10.601%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-187.417ns; +318.136ns] or [-6.524%; +11.075%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-75.143ns; +74.174ns] or [-6.354%; +6.272%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3966.195ns; +3983.711ns] or [-9.710%; +9.753%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-872.762ns; +699.743ns] or [-10.640%; +8.531%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-63.574µs; +54.522µs] or [-10.122%; +8.681%]

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 [+67.368µs; +73.488µs] or [+27.417%; +29.908%]

scenario:span-start

  • 🟥 execution_time [+1.218ms; +1.488ms] or [+8.744%; +10.684%]

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

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Aug 28, 2026

Copy link
Copy Markdown

Pipelines  Tests

⚠️ 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 | Debian_11_amd64.SID0: [test-app-python]

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-py | Ubuntu_24_amd64.SI94: [test-app-python-alpine]

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: a364db4 | Docs | View more details | Give us feedback!

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

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant