-
Notifications
You must be signed in to change notification settings - Fork 579
Open
Labels
Description
Ideally, we want all unsampled spans to be no-op spans. Currently, a span can be unsampled at two points in time:
- when
ignore_spansis evaluated for the specific span - when the span's sampling decision is made
The former happens before the span is actually created, allowing us to either create a normal or no-op span in the respective cases (not ignored vs ignored).
The latter currently happens after the span is created, more specifically when it is started. This distinction between created vs started is important because we support the following:
span = sentry_sdk.traces.start_span(name="span") # span is created
span.start() # span is started (sampling decision is made)
span.end()If creating and starting a span is decoupled, and we want to sample on start (so also users' traces_samplers are run on start()), we don't know whether to create a normal or no-op span early enough.
Ways to go around it:
- no
start()API, spans are just started when created in non-context-manager mode, and bothignore_spansAND the sampling decision are made before the actual span object is created - …
Reactions are currently unavailable