Repository navigation
feat: honour OTEL_TRACES_SAMPLER and add sampler options across the traceAI SDKs - #711
Merged
Merged
Conversation
…hen FI_SAMPLE_RATE is not set
…when FI_SAMPLE_RATE is not set
…TEL_TRACES_SAMPLER when FI_SAMPLE_RATE is not set
…FI_SAMPLE_RATE is not set
…and a sampler option on Register
…t honours OTEL_TRACES_SAMPLER when FI_SAMPLE_RATE is not set
…n FI_SAMPLE_RATE is not set
…a sampler harness a span processor
This was referenced Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lets you choose the head sampler the standard OpenTelemetry way wherever traceAI creates its own tracer provider, in all six SDKs.
Behaviour
FI_SAMPLE_RATE(or the explicit sample-rate option) is not set,OTEL_TRACES_SAMPLERandOTEL_TRACES_SAMPLER_ARGare honoured with each OpenTelemetry SDK's own semantics:always_on,always_off,traceidratio,parentbased_always_on,parentbased_always_off,parentbased_traceidratio.FI_SAMPLE_RATEstill wins and keeps today'sParentBased(TraceIdRatio(rate)).ParentBased(TraceIdRatio(1.0))with one warning; it never throws.TraceAI.init(TraceConfig)and C#TraceAI.Register(RegisterOptions)gain an optional sampler, used only when that call creates the provider.Languages
Python (
fi_instrumentation.auto), TypeScript (@traceai/auto), Java (core + agent), Go (go/auto), C# (FIInstrumentation + auto), Ruby (traceai-auto). Each language has a test commit followed by its implementation, and its README/configuration docs describe the precedence.