Skip to content

chore: improve IPC typing and error handling - #20111

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
chore/ipc-improve-typing-error-handling
Sep 16, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
chore/ipc-improve-typing-error-handling

Conversation

@P403n1x87

Copy link
Copy Markdown
Collaborator

Description

We improve the typing of the IPC utilities as well as the error handling of the expected failure modes to reduce the noise level in telemetry data.

@P403n1x87 P403n1x87 added the changelog/no-changelog A changelog entry is not required for this PR. label Sep 7, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Sep 7, 2026 •

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

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

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

Show existing violations (showing 5 of 218 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=133)
ddtrace.llmobs._integrations.langchain -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=131)
ddtrace.llmobs._integrations.anthropic -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=131)
ddtrace.llmobs._integrations.pydantic_ai -×-> ddtrace.trace  (product:llmobs -> product:tracing, score=131)
ddtrace.profiling.collector.stack -×-> ddtrace.trace  (product:profiling -> product:tracing, score=131)

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

cit-pr-commenter-54b7da Bot commented Sep 7, 2026 •

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.

No remaining files require a CODEOWNERS review.

@datadog-official

datadog-official Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

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

@pr-commenter

pr-commenter Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-15 14:14:31

Comparing candidate commit 349549e in PR branch chore/ipc-improve-typing-error-handling with baseline commit f006b59 in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 1 performance regressions! Performance is the same for 572 metrics, 10 unstable metrics, 5 known flaky benchmarks, 19 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:iastaspects-lstrip_aspect

  • 🟥 execution_time [+42.421µs; +47.987µs] or [+15.144%; +17.131%]

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 [-660.924ns; +821.053ns] or [-5.968%; +7.414%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-37.474ns; +28.679ns] or [-6.076%; +4.650%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-2067.734ns; +1195.669ns] or [-12.060%; +6.974%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1034.161ns; +1412.320ns] or [-7.972%; +10.888%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-326.078ns; +319.091ns] or [-8.831%; +8.642%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-314.998ns; +189.858ns] or [-10.660%; +6.425%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-52.663ns; +98.907ns] or [-4.580%; +8.602%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-3997.480ns; +3983.295ns] or [-9.721%; +9.686%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-684.917ns; +856.770ns] or [-8.447%; +10.566%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-55904.526ns; +55727.044ns] or [-9.565%; +9.534%]

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

  • 🟥 execution_time [+2.614µs; +2.776µs] or [+15.762%; +16.736%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+117.191µs; +123.763µs] or [+30.296%; +31.995%]

scenario:span-start

  • 🟥 execution_time [+2.060ms; +2.298ms] or [+14.975%; +16.699%]

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

  • 🟥 execution_time [+592.810ns; +631.660ns] or [+21.473%; +22.880%]

scenario:tracer-small

  • 🟥 execution_time [+35.377µs; +37.754µs] or [+11.293%; +12.052%]

Known flaky benchmarks without significant changes:

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

@P403n1x87
P403n1x87 marked this pull request as ready for review September 8, 2026 10:28
@P403n1x87
P403n1x87 requested a review from a team as a code owner September 8, 2026 10:28

@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: 9e730b20c1

ℹ️ 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 ddtrace/internal/ipc.py
Comment thread tests/internal/test_ipc.py Outdated
Comment thread tests/internal/test_ipc.py Outdated
We improve the typing of the IPC utilities as well as the error handling
of the expected failure modes to reduce the noise level in telemetry
data.
@P403n1x87
P403n1x87 force-pushed the chore/ipc-improve-typing-error-handling branch from 9e730b2 to 3c8c984 Compare September 8, 2026 11:24
@P403n1x87

Copy link
Copy Markdown
Collaborator Author

/merge -m squash

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-09-15 13:42:03 UTC ℹ️ Start processing command /merge -m squash


2026-09-15 13:42:11 UTC ℹ️ MergeQueue: Pull request is not mergeable yet

It will be processed automatically as soon as GitHub reports it as mergeable. View in MergeQueue UI.

  • Run /code blockers to see what is blocking it.
  • Run /remove to cancel it.

2026-09-15 14:34:28 UTC ℹ️ MergeQueue: merge request added to the queue

The expected merge time in main is approximately 54m (p90).


2026-09-15 15:04:20 UTC ❌ MergeQueue: The build pipeline contains failing jobs for this merge request

Build pipeline has failing jobs for 7d23bdd:

⚠️ Do NOT retry failed jobs directly (why?).

What to do next?

  • Investigate the failures and when ready, re-add your pull request to the queue!
  • If your PR checks are green, try to rebase/merge. It might be because the CI run is a bit old.
  • Any question, go check the FAQ.
Details

Since those jobs are not marked as being allowed to fail, the pipeline will most likely fail.
Therefore, and to allow other builds to be processed, this merge request has been rejected and the pipeline got canceled.

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit a1382ff into main Sep 16, 2026
1461 of 1462 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the chore/ipc-improve-typing-error-handling branch September 16, 2026 11:31
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.

3 participants