Skip to content

Commit

Permalink
instrumentation: use parent-based sampling.
Browse files Browse the repository at this point in the history
If we have a tracing enabled, we always want to sample
spans whenever
  - our own probabilistic sampler says so, or
  - we have a parent span and it is being sampled

Therefore use a parent-based probabilistic sampler instead
of just a probabilistic one.

Signed-off-by: Krisztian Litkey <[email protected]>
  • Loading branch information
klihub committed Jan 15, 2024
1 parent 53d4607 commit 55bcc99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/instrumentation/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (t *tracing) start(options ...Option) error {
sdktrace.NewBatchSpanProcessor(exporter),
),
sdktrace.WithSampler(
sdktrace.TraceIDRatioBased(t.sampling),
sdktrace.ParentBased(sdktrace.TraceIDRatioBased(t.sampling)),
),
)

Expand Down

0 comments on commit 55bcc99

Please sign in to comment.