Skip to content

Using otel tracer sampler #5141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* [CHANGE] Alertmanager: Local file disclosure vulnerability in OpsGenie configuration has been fixed. #5045
* [CHANGE] Rename oltp_endpoint to otlp_endpoint to match opentelemetry spec and lib name. #5067
* [CHANGE] Distributor/Ingester: Log warn level on push requests when they have status code 4xx. Do not log if status is 429. #5103
* [CHANGE] Tracing: Use the default OTEL trace sampler when `-tracing.otel.exporter-type` is set to `awsxray`. #5141
* [ENHANCEMENT] Update Go version to 1.19.3. #4988
* [ENHANCEMENT] Querier: limit series query to only ingesters if `start` param is not specified. #4976
* [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
Expand Down
55 changes: 0 additions & 55 deletions pkg/tracing/sampler/sampling.go

This file was deleted.

69 changes: 0 additions & 69 deletions pkg/tracing/sampler/sampling_test.go

This file was deleted.

5 changes: 2 additions & 3 deletions pkg/tracing/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
semconv "go.opentelemetry.io/otel/semconv/v1.17.0"

"github.com/cortexproject/cortex/pkg/tracing/migration"
"github.com/cortexproject/cortex/pkg/tracing/sampler"
util_log "github.com/cortexproject/cortex/pkg/util/log"
"github.com/cortexproject/cortex/pkg/util/tls"
)
Expand Down Expand Up @@ -147,12 +146,12 @@ func newTraceProvider(r *resource.Resource, c Config, exporter *otlptrace.Export
switch strings.ToLower(c.Otel.ExporterType) {
case "awsxray":
options = append(options, sdktrace.WithIDGenerator(xray.NewIDGenerator()))
options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sampler.NewXrayTraceIDRatioBased(c.Otel.SampleRatio))))
propagator = xray.Propagator{}
default:
options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(c.Otel.SampleRatio))))
}

options = append(options, sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(c.Otel.SampleRatio))))

return propagator, sdktrace.NewTracerProvider(options...)
}

Expand Down