Provide interim sampling capability in exporter #5
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.
There's plenty of progress on the OT specification. If you can wait, you don't need to use this capability. Reading material:
sampling.priority
: Proposal for sampling.priority open-telemetry/oteps#107ParentNotRemoteOrElse
and fixProbability
sampler definition Rename ParentOrElse to ParentBased and generalize to support all cases open-telemetry/opentelemetry-specification#610As the README change puts it:
That said, some Honeycomb customers need to be able to sample right now because of a change in their pricing model. It's literally a choice between sampling in a Honeycomb-sympathetic way, or turning it off. So, this branch provides a workaround:
You set some attribute on your spans eg.
hc_sample
to indicate your preferred sample rate, as a positive integer: 4 means you're dropping 75% of spansYou configure the exporter with
samplerate_key
set to something eg."hc_sample"
The exporter pops
"hc_sample"
out of the attribute map so it's no longer confusable for a measurement, and _moves it to the HCsamplerate
keyThe exporter also drops all but 1 in
samplerate
spans before exportIt's crude, but it'll do for now.