-
Notifications
You must be signed in to change notification settings - Fork 141
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
Sampler that passes spans based on name prefix #54
Comments
The opposite of this would also be super useful... To remove spans based on name. |
If it's about manual sampling instead of relying on name, I think context attribute to force sampling can work and more flexible. |
One more option to always include manual spans is to use InstrumentationLibrary.Name: if it does not start with |
how would you implement that with a Sampler? Samplers don't have access to the Tracer implementation being used to create the span. |
The usage then looks something like this?
I agree, it's more explicit that way and requires less fiddling with the sampler and specifying some names. There's probably opportunity to make that even more convenient with helpers on the |
They are going to, hopefully: open-telemetry/opentelemetry-specification#1588 |
Users have asked for a way to ensure that their manually created spans are never sampled out while still allowing the rest of instrumentation to sample normally. One approach I'm suggesting here is to create a new sampler that can be preconfigured with a set of span name prefixes to always include. That is, if a span name starts with one of the prefixes, it always passes. If it does not, then this sampler will delegate to another sampler.
Might be a little tricky to choose a name for this. Something like
NamePrefixedForceInclusionSampler
.The text was updated successfully, but these errors were encountered: