Overview
Sentry supports two types of sampling:- Error Sampling - Controls error events
- Trace Sampling - Controls transaction/span events
Error Sampling
sampleRate
Simple percentage-based sampling for error events:number
default:"1.0"
Float between 0.0 (0%) and 1.0 (100%) of error events to send.
packages/core/src/client.ts:
Trace Sampling
tracesSampleRate
Simple percentage-based sampling for traces:number
Float between 0.0 (0%) and 1.0 (100%) of traces to send.
tracesSampler
Dynamic sampling function for fine-grained control:SamplingContext
Context data for making sampling decisions.
string
Transaction/span name.
SpanAttributes
Span attributes including operation, HTTP method, etc.
boolean
Whether the parent span was sampled.
object
Additional transaction context.
object
Request data (Node.js/server-side).
object
Browser location (browser-side).