Skip to content

Commit e41a88c

Browse files
alanprotalexqyle
authored andcommitted
Using otel tracer sampler (cortexproject#5141)
* Using otel tracer sampler Signed-off-by: Alan Protasio <[email protected]> * Changelog Signed-off-by: Alan Protasio <[email protected]> --------- Signed-off-by: Alan Protasio <[email protected]> Signed-off-by: Alex Le <[email protected]>
1 parent d2fc6c9 commit e41a88c

File tree

4 files changed

+3
-127
lines changed

4 files changed

+3
-127
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [CHANGE] Alertmanager: Local file disclosure vulnerability in OpsGenie configuration has been fixed. #5045
66
* [CHANGE] Rename oltp_endpoint to otlp_endpoint to match opentelemetry spec and lib name. #5067
77
* [CHANGE] Distributor/Ingester: Log warn level on push requests when they have status code 4xx. Do not log if status is 429. #5103
8+
* [CHANGE] Tracing: Use the default OTEL trace sampler when `-tracing.otel.exporter-type` is set to `awsxray`. #5141
89
* [ENHANCEMENT] Update Go version to 1.19.3. #4988
910
* [ENHANCEMENT] Querier: limit series query to only ingesters if `start` param is not specified. #4976
1011
* [ENHANCEMENT] Query-frontend/scheduler: add a new limit `frontend.max-outstanding-requests-per-tenant` for configuring queue size per tenant. Started deprecating two flags `-query-scheduler.max-outstanding-requests-per-tenant` and `-querier.max-outstanding-requests-per-tenant`, and change their value default to 0. Now if both the old flag and new flag are specified, the old flag's queue size will be picked. #5005

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)