sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

feat(tracing) Collect DSC for head of trace

Open smeubank opened this issue 3 years ago • 1 comments

Describe the idea

Applications instrumented with a Sentry SDK should collect and propagate dynamic sampling context data to all outgoing requests and to Sentry.

Requirement:

When an application has an event which is the head of a trace, the SDK shall collect and propagate all possible values in outgoing requests and to Sentry so that contextual data can be propagated in all connected services across the continuation of trace

what should be sent?

baggage header

  • [ ] sentry-trace_id
  • [ ] sentry-public_key
  • [ ] sentry-sample_rate
  • [ ] sentry-release
  • [ ] sentry-environment
  • [ ] sentry-user_id
  • [ ] sentry-user_segment
  • [ ] sentry-transaction

Envelope Header

  • [ ] trace_id (string)
  • [ ] public_key (string)
  • [ ] sample_rate (string)
  • [ ] release (string)
  • [ ] environment (string)
  • [ ] user_id (string)
  • [ ] user_segment (string)
  • [ ] transaction (string)

where should it be sent?

  • in dynamic sample context (by baggage)
  • in the envelope header
  • meta data (was/is being done in JS to be check if still necessary)

Example: Here is an example from the Sentry UI, where the implementation has already begun on the latest versions of the JS SDK. A request from the front end to a down stream applications includes in the request header baggage

image

Why do you think it's beneficial to most of the users

This ensures that further downstream applications connected in a distributed trace will receive all contextual data required for dynamically sampling.

Possible implementation

Implementation has already begun (at the time of this creation) on JS and Android. Refer to the SDK Developer documentation for further information

For full up to date requirements according to SDK Developer specifications please see the associated documentation.

Dynamic Sampling Context

Original PR for full context Add spec for Dynamic Sampling Context #613

smeubank avatar Jun 27 '22 07:06 smeubank

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Jul 19 '22 00:07 github-actions[bot]