Skip to content

Commit ce2ec8b

Browse files
committed
Using otel tracer sampler
1 parent f0a5551 commit ce2ec8b

File tree

3 files changed

+2
-127
lines changed

3 files changed

+2
-127
lines changed

pkg/tracing/sampler/sampling.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

pkg/tracing/sampler/sampling_test.go

Lines changed: 0 additions & 69 deletions
This file was deleted.

pkg/tracing/tracing.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"
2323

2424
"github.com/cortexproject/cortex/pkg/tracing/migration"
25-
"github.com/cortexproject/cortex/pkg/tracing/sampler"
2625
util_log "github.com/cortexproject/cortex/pkg/util/log"
2726
"github.com/cortexproject/cortex/pkg/util/tls"
2827
)
@@ -147,12 +146,12 @@ func newTraceProvider(r *resource.Resource, c Config, exporter *otlptrace.Export
147146
switch strings.ToLower(c.Otel.ExporterType) {
148147
case "awsxray":
149148
options = append(options, sdktrace.WithIDGenerator(xray.NewIDGenerator()))
150-
options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sampler.NewXrayTraceIDRatioBased(c.Otel.SampleRatio))))
151149
propagator = xray.Propagator{}
152150
default:
153-
options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(c.Otel.SampleRatio))))
154151
}
155152

153+
options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(c.Otel.SampleRatio))))
154+
156155
return propagator, sdktrace.NewTracerProvider(options...)
157156
}
158157

0 commit comments

Comments
 (0)