Skip to content

chore: fix ER single snapshot capture #13642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 14, 2025
Merged

Conversation

P403n1x87
Copy link
Contributor

@P403n1x87 P403n1x87 commented Jun 11, 2025

We fix the logic that ensures that we have at least one ER capture when the traceback comprises only third-party frames.

Checklist

  • PR author has checked that all the criteria below are met
  • The PR description includes an overview of the change
  • The PR description articulates the motivation for the change
  • The change includes tests OR the PR description describes a testing strategy
  • The PR description notes risks associated with the change, if any
  • Newly-added code is easy to change
  • The change follows the library release note guidelines
  • The change includes or references documentation updates if necessary
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Reviewer has checked that all the criteria below are met
  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Newly-added code is easy to change
  • Release note makes sense to a user of the library
  • If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

We fix the logic that ensures that we have at least one ER capture when
the traceback comprises only third-party frames.
@P403n1x87 P403n1x87 requested a review from tylfin June 11, 2025 10:56
@P403n1x87 P403n1x87 requested a review from a team as a code owner June 11, 2025 10:56
@P403n1x87 P403n1x87 added the Dynamic Instrumentation Dynamic Instrumentation/Live Debugger label Jun 11, 2025
@P403n1x87 P403n1x87 requested a review from a team as a code owner June 11, 2025 10:56
@P403n1x87 P403n1x87 requested a review from avara1986 June 11, 2025 10:56
@P403n1x87 P403n1x87 enabled auto-merge (squash) June 11, 2025 10:56
Copy link
Contributor

CODEOWNERS have been resolved as:

ddtrace/debugging/_exception/replay.py                                  @DataDog/debugger-python
tests/debugging/exception/test_replay.py                                @DataDog/debugger-python
tests/utils.py                                                          @DataDog/python-guild

Copy link
Contributor

github-actions bot commented Jun 11, 2025

Bootstrap import analysis

Comparison of import times between this PR and base.

Summary

The average import time from this PR is: 282 ± 7 ms.

The average import time from base is: 283 ± 7 ms.

The import time difference between this PR and base is: -0.5 ± 0.3 ms.

The difference is not statistically significant (z = -1.47).

Import time breakdown

The following import paths have shrunk:

ddtrace.auto 1.250 ms (0.44%)
ddtrace 0.648 ms (0.23%)
ddtrace.bootstrap.sitecustomize 0.603 ms (0.21%)
ddtrace.bootstrap.preload 0.603 ms (0.21%)
ddtrace.internal.remoteconfig.client 0.603 ms (0.21%)

@pr-commenter
Copy link

pr-commenter bot commented Jun 11, 2025

Benchmarks

Benchmark execution time: 2025-06-13 21:09:38

Comparing candidate commit f652471 in PR branch chore/fix-er-single-capture with baseline commit 1f87a5e in branch main.

Found 0 performance improvements and 2 performance regressions! Performance is the same for 563 metrics, 7 unstable metrics.

scenario:iastaspectsospath-ospathnormcase_aspect

  • 🟥 execution_time [+388.722ns; +439.014ns] or [+11.226%; +12.678%]

scenario:iastaspectsospath-ospathsplit_aspect

  • 🟥 execution_time [+517.195ns; +743.394ns] or [+10.725%; +15.416%]

@tylfin
Copy link
Contributor

tylfin commented Jun 11, 2025

@P403n1x87 Does code origins also need this same change? I noticed a span with _dd.code_origin.type: exit with no code origin information on it

@P403n1x87
Copy link
Contributor Author

@P403n1x87 Does code origins also need this same change? I noticed a span with _dd.code_origin.type: exit with no code origin information on it

Ah interesting. If there is no code origin information it means that the full stack does not have any user frames 🤔 I think it would be hard to choose which frames to capture in this case

@P403n1x87 P403n1x87 added the changelog/no-changelog A changelog entry is not required for this PR. label Jun 14, 2025
@P403n1x87 P403n1x87 merged commit 990b1bf into main Jun 14, 2025
823 of 824 checks passed
@P403n1x87 P403n1x87 deleted the chore/fix-er-single-capture branch June 14, 2025 13:53
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. Dynamic Instrumentation Dynamic Instrumentation/Live Debugger
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants