Skip to content
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

fix: maintain jaeger trace b3 sampled state #726

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions otelx/jaeger.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
)

// Optionally, Config.Providers.Jaeger.LocalAgentAddress can be set.
// NOTE: If Config.Providers.Jaeger.Sampling.ServerURL is not specfied,
// AlwaysSample is used.
// NOTE: If Config.Providers.Jaeger.Sampling.ServerURL is not specified,
// the otel spec default `ParentBased(AlwaysSample())` is used.
func SetupJaeger(t *Tracer, tracerName string, c *Config) (trace.Tracer, error) {
host, port, err := net.SplitHostPort(c.Providers.Jaeger.LocalAgentAddress)
if err != nil {
Expand Down Expand Up @@ -54,7 +54,7 @@ func SetupJaeger(t *Tracer, tracerName string, c *Config) (trace.Tracer, error)
)
tpOpts = append(tpOpts, sdktrace.WithSampler(jaegerRemoteSampler))
} else {
tpOpts = append(tpOpts, sdktrace.WithSampler(sdktrace.AlwaysSample()))
tpOpts = append(tpOpts, sdktrace.WithSampler(sdktrace.ParentBased(sdktrace.AlwaysSample())))
}
tp := sdktrace.NewTracerProvider(tpOpts...)
otel.SetTracerProvider(tp)
Expand Down
Loading