Remove hardcoded AlwaysSample from OpenTelemetry tracing configuration #9229
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.
Changes proposed by this PR
This pull request is a follow on the discussion raised here: #9227
Concourse currently hardcodes an
AlwaysSample
sampler in the OpenTelemetry SDK setup which generally means that this will always hold true. Any attempts to customise the sample rate via environment variables will not work as Go treats explicit SDK configuration as having precedent over anything else.This should not change any existing behaviour as the default setting for sampling is to use the AlwaysOn sampler but it should become possible to set other samples + custom sample rate via the
OTEL_TRACES_SAMPLER
environment variable.AlwaysSample
clauseNotes to reviewer
It's worth nothing that I haven't tested this out to confirm that it behaviour as I would assume it does. I need to get Concourse set up so I can do some local experiments and so on but at a glance, it should do what it says on the tin if the OpenTelemetry documentation is to be trusted.
Happy to have this PR in pending until I properly set it up locally though.
Release Note
OTEL_TRACES_SAMPLER
environment variable.