Skip to content

Tracing without Performance #2056

@stephanie-anderson

Description

@stephanie-anderson

Description

Internal Notion Page:
https://www.notion.so/sentry/Tracing-without-performance-efab307eb7f64e71a04f09dc72722530

To always have access to a trace and span ID, add a new internal PropagationContext property to the scope, an object holding a traceId and spanId and an optional dynamicSamplingContext.

Populate the traceId and spanId with valid, random IDs on construction.

You may update the traceId and dynamicSamplingContext from the request headers during an incoming request or if the process was exposed to a SENTRY_TRACE and/or SENTRY_BAGGAGE environment variable if performance is disabled.

The Dynamic Sampling Context should be lazily constructed once needed, using a new fromOptions function that constructs the DSC based on the client options if performance is disabled.

When captureEvent is called, you may use these values on the scope as a fallback to construct the trace context and envelope header item if no transaction exists in the SDK.

For outgoing HTTP requests, use the values in the scope as a fallback if no transaction is present. The sentry-trace will contain a trailing -0 indicating an unsampled transaction.

### Task List for each SDK
- [x] All events are always sent through the `/envelope` endpoint if performance is enabled. (If possible just always use `/envelope`)
- [ ] https://github.com/getsentry/sentry-ruby/issues/2099
- [x] All **error**, **transaction** and **check-in** events sent to Sentry always contain a Dynamic Sampling Context (trace) envelope header item.
- [x] All **error, transaction** and **check-in** sent to Sentry always contain [a `trace` context](https://develop.sentry.dev/sdk/event-payloads/contexts/#trace-context).
- [x] All outgoing **HTTP requests** always contain a `sentry-trace` and `baggage` header if the destination is allow-listed in [[tracePropagationTargets](https://develop.sentry.dev/sdk/performance/#tracepropagationtargets)](https://develop.sentry.dev/sdk/performance/#tracepropagationtargets). https://github.com/getsentry/sentry-ruby/issues/2078
- [ ] Create detailed docs about how to setup distributed tracing
- [x] Set the `replay` context (Python & PHP only) https://develop.sentry.dev/sdk/event-payloads/contexts/#replay-context

Metadata

Metadata

Assignees

Labels

No labels
No labels
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions