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

Add tail based tracing sampling #14

Open
komuw opened this issue Sep 7, 2023 · 0 comments
Open

Add tail based tracing sampling #14

komuw opened this issue Sep 7, 2023 · 0 comments

Comments

@komuw
Copy link
Owner

komuw commented Sep 7, 2023

There's head-based sampling and tail-based sampling.

In #13 we added head based sampling.
But it would be nice to add sampling that would let us say something like;
Sample 5% of success but 100% of all the errors.

In

otero/tracing.go

Lines 64 to 79 in 903452e

provider := trace.NewTracerProvider(
trace.WithBatcher(exporter), // use batch in prod.
trace.WithResource(resource),
trace.WithSpanProcessor(loggingSpanProcessor{}),
trace.WithSampler(
// Sample 30%
//
// There's head-based sampling and tail-based sampling.
// Tail based sampling would enable you to say something like;
// `Sample 5% of success but 100% of all the errors.`
//
// What we have implemented here is head-based sampling.
// See: https://github.com/komuw/otero/issues/11 (and the links therein)
trace.ParentBased(trace.TraceIDRatioBased(0.3)),
),
)

komuw added a commit that referenced this issue Sep 7, 2023
This adds head based sampling. 
In future we should probably add tail based sampling; #14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant