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

Tracing without Performance #2056

Closed
5 of 7 tasks
Tracked by #5
stephanie-anderson opened this issue Jun 19, 2023 · 1 comment · Fixed by #2084
Closed
5 of 7 tasks
Tracked by #5

Tracing without Performance #2056

stephanie-anderson opened this issue Jun 19, 2023 · 1 comment · Fixed by #2084
Assignees

Comments

@stephanie-anderson
Copy link
Contributor

stephanie-anderson commented Jun 19, 2023

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

  1. enhancement
    sl0thentr0py
@stephanie-anderson stephanie-anderson changed the title Ruby Tracing without Performance Jun 19, 2023
@stephanie-anderson stephanie-anderson transferred this issue from getsentry/team-webplatform-meta Jun 19, 2023
sl0thentr0py added a commit that referenced this issue Sep 1, 2023
This PR is 1/2 to enable **Tracing without Performance**, i.e. make sure all our events are connected even if they are not Transactions.

This enables use cases such as Errors / Transactions / Replays etc all being connected across services and not just Transactions.

### Summary of changes

* new `PropagationContext` class that generates trace/span ids and baggage irrespective of whether there are transactions/spans active or not
* this lives on the `Scope`
* three new top level methods that first check the span and fallback on the scope's propagation context
  * `Sentry.get_traceparent`
  * `Sentry.get_baggage`
  * `Sentry.get_trace_propagation_headers`
* move `dynamic_sampling_context` to `Event` from `TransactionEvent` since all events will now have this info
* use the new top level helpers in `net/http` patch to set propagation headers

closes #2056 
also see #2089 

---

This PR is 2/2 to enable Tracing without Performance, i.e. make sure all our events are connected even if they are not Transactions.

### Summary of changes
* Implement new top level `Sentry.continue_trace(env, **options)` API that standardizes continuing an incoming trace from a rack env like hash.
* Use this new API in rack/rails/sidekiq

part of #2056 
linked to #2084
@sl0thentr0py sl0thentr0py reopened this Sep 1, 2023
@sl0thentr0py
Copy link
Member

tracking env variables separately, closing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants