Skip to content

Dynamic Sampling Context / Baggage continuation #1485

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 21 commits into from
Jul 8, 2022
Merged

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Jul 4, 2022

  • Baggage class implementing sentry/third party/mutable logic with parsing from header and serialization
  • Parse incoming baggage header while starting transaction and store it on the transaction
  • Extract dynamic_sampling_context fields and add to the trace field in the envelope header while sending the transaction
  • Propagate the baggage header (only sentry fields / no third party as per spec)

DSC Spec
fixes #1476

@sl0thentr0py
Copy link
Member Author

E2E testing dump (from different runs of the same request /api/shows/ from react)

Outgoing request from react:

GET /api/shows/?q=test HTTP/1.1
sentry-trace: 29fe0a09960b4c06b3d60d7dd653b5eb-96813dbb300bb498-1
baggage: sentry-environment=dev,sentry-release=0.0.1,sentry-transaction=%2Fapi%2Fshows%2F%3Fq%3Dtest,sentry-user_id=278612,sentry-user_segment=Some%20segment%20(485744)%7D,sentry-public_key=e39cc598149f46899082d1348c4abac1,sentry-trace_id=29fe0a09960b4c06b3d60d7dd653b5eb,sentry-sample_rate=1

Incoming baggage header:

(Pdb) headers.get('baggage')
'sentry-environment=dev,sentry-release=0.0.1,sentry-transaction=%2Fapi%2Fshows%2F%3Fq%3Dtest,sentry-user_id=970676,sentry-user_segment=Some%20segment%20(763434)%7D,sentry-public_key=e39cc598149f46899082d1348c4abac1,sentry-trace_id=ad113195e0614ecca6598645db4114bd,sentry-sample_rate=1'

trace envelope header in transaction payload in transport.capture_envelope

(Pdb) envelope.headers["trace"]
{'trace_id': 'a207344557f04656bb7aeff10c725312', 'public_key': 'e39cc598149f46899082d1348c4abac1', 'sample_rate': '1', 'release': '0.0.1', 'environment': 'dev', 'transaction': '/api/shows/?q=tes', 'user_id': '970676', 'user_segment': 'Some segment (763434)}'}

@sl0thentr0py sl0thentr0py changed the title Dynamic Sampling Context WIP Dynamic Sampling Context / Baggage continuation Jul 5, 2022
@sl0thentr0py sl0thentr0py marked this pull request as ready for review July 5, 2022 12:06
@sl0thentr0py sl0thentr0py requested a review from antonpirker July 5, 2022 12:11
Copy link
Contributor

@vladanpaunovic vladanpaunovic left a comment

Choose a reason for hiding this comment

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

LGTM

@sl0thentr0py sl0thentr0py enabled auto-merge (squash) July 8, 2022 14:06
@sl0thentr0py sl0thentr0py merged commit 52e80f0 into master Jul 8, 2022
@sl0thentr0py sl0thentr0py deleted the neel/baggage branch July 8, 2022 14:08
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.

feat(tracing) [DSC] Dynamic Sampling Context continuation
4 participants