Skip to content
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

fix(distributed_tracing): ensure ASM standalone operates on all propagation styles #11875

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Jan 8, 2025

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

@mabdinur mabdinur requested review from a team as code owners January 8, 2025 17:12
Copy link
Contributor

github-actions bot commented Jan 8, 2025

CODEOWNERS have been resolved as:

releasenotes/notes/fix-asm-standalone-propagation-7bdb5a040ef82bac.yaml  @DataDog/apm-python
ddtrace/propagation/http.py                                             @DataDog/apm-sdk-api-python

@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: munir/maybe-fix-asm-standalone-propagation
Commit report: 5126ddc
Test service: dd-trace-py

✅ 0 Failed, 1152 Passed, 316 Skipped, 21m 37.1s Total duration (15m 48.29s time saved)

@pr-commenter
Copy link

pr-commenter bot commented Jan 8, 2025

Benchmarks

Benchmark execution time: 2025-01-08 17:53:39

Comparing candidate commit 5126ddc in PR branch munir/maybe-fix-asm-standalone-propagation with baseline commit 3d08709 in branch main.

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

scenario:iast_aspects-ospathjoin_aspect

  • 🟥 execution_time [+372.694ns; +443.923ns] or [+7.261%; +8.648%]

scenario:iast_aspects-ospathsplit_aspect

  • 🟥 execution_time [+369.232ns; +436.139ns] or [+9.676%; +11.429%]

scenario:iast_aspects-ospathsplitdrive_aspect

  • 🟥 execution_time [+199.907ns; +238.812ns] or [+7.552%; +9.021%]

scenario:iast_aspects-replace_aspect

  • 🟥 execution_time [+606.813ns; +689.944ns] or [+8.936%; +10.161%]

Copy link
Contributor

@Yun-Kim Yun-Kim left a comment

Choose a reason for hiding this comment

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

Moving the ASM distributed header propagation to HTTPPropagator makes sense, but just a little confused why this behavior (disregarded whether tracer was enabled or not) was occuring in the first place.

---
fixes:
- |
ASM: Fixed an issue where distributed tracing headers were improperly propagated when tracing was disabled. Now, headers are only propagated for traces with the _dd.p.appsec tag, regardless of the propagation style (e.g., TraceContext). Previously, this logic applied only to Datadog headers, potentially allowing invalid trace info to be injected or extracted.
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to clarify - previously we were only propagating ASM distributed tracing headers on Datadog headers regardless if tracing was enabled/disabled? Is this because DatadogMultiHeaders._inject() doesn't account for tracing being enabled/disabled?

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