Skip to content

debugger: scrub API Security schema tags from exception replay span approvals - #7543

Merged
dromanol merged 1 commit into
mainfrom
dani/scrub-api-security-schemas-exception-replay
Aug 20, 2026
Merged

debugger: scrub API Security schema tags from exception replay span approvals#7543
dromanol merged 1 commit into
mainfrom
dani/scrub-api-security-schemas-exception-replay

Conversation

@dromanol

Copy link
Copy Markdown
Contributor

Motivation

Test_Debugger_Exception_Replay::test_exception_replay_rockpaperscissors compares the aspnet_core.request spans against a stored approval, and the .NET tracer is about to start emitting API Security schemas (_dd.appsec.s.*) on error responses (dd-trace-dotnet#9082 makes the response phase reach the WAF for server-generated 500s).

Those tags cannot be pinned in an approval: API Security samples schemas once per (route, method, status) per DD_API_SECURITY_SAMPLE_DELAY (30s by default), which is the same order of magnitude as this test's own retry interval (_timeout_next = 30). Which of the three rock/paper/scissors requests carries the schemas is therefore a race — in the failing run it was the rock span, and it could just as easily be another one or none.

Changes

Drop every _dd.appsec.s.* key in _validate_spans, the same treatment the _dd.appsec.fp.* fingerprints already get. No approval file currently contains those keys, so no expected data changes.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

…pprovals

API Security samples schemas per (route, method, status) within a time window
(30s by default), the same order as the test's own retry interval, so whether a
given request carries `_dd.appsec.s.*` is not deterministic. Remove those keys
like the `_dd.appsec.fp.*` fingerprints already are.
@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/debugger/test_debugger_exception_replay.py                        @DataDog/debugger @DataDog/system-tests-core

@datadog-datadog-prod-us1-2 datadog-datadog-prod-us1-2 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.

Datadog Autotest: PASS

More details

The prefix filter removes nondeterministic API Security schema tags from both supported span formats before approval comparison, while it keeps unrelated validation unchanged.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Datadog Autotest · Commit a605ce2 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@dromanol
dromanol enabled auto-merge (squash) August 20, 2026 09:05

@dudikeleti dudikeleti left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks

@dromanol
dromanol merged commit c688030 into main Aug 20, 2026
422 checks passed
@dromanol
dromanol deleted the dani/scrub-api-security-schemas-exception-replay branch August 20, 2026 09:31
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.

2 participants