-
Notifications
You must be signed in to change notification settings - Fork 675
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
🚀 Feature: Support for trace sampling #2109
Comments
Thanks @nitin302 - we support it on the Traceloop platform, and this is supported through a standard OpenTelemetry collector, which is the recommended deployment for high-scale applications. Is that what you're looking for? |
do you suggest via these - https://opentelemetry.io/docs/concepts/sampling/#collector |
@nitin302 exactly |
@nirga since we use batching via disable_batch, do you think sampling directly via the library is not required? |
@nitin302, no you can do it on the collector level and it should work. We can keep this open cause I think supporting this through the SDK itself is valuable - but I'd say there are good ways to do it today even without the SDK itself. |
I am interested in contributing to this issue. Can you provide an overview of what has to be done. |
I would look into implementing something similar to otel samplers - https://opentelemetry.io/docs/concepts/sampling/ |
Just to confirm my understanding: In the OpenTelemetry Collector, we configure the sampling rate through the sampling_percentage parameter in the config file. Following @nitin302 's suggestion, I believe the request is to allow for setting the sampling rate directly in the SDK constructor (similar to how Langfuse handles it), rather than relying on external configurations. |
Exactly @Nikhil172913832. And potentially this is a feature already supported by the underlying OpenTelemetry SDK |
The approach I thought of is to provide an optional argument in the TracerWrapper class in packages/traceloop-sdk/traceloop/sdk/tracing/tracing.py. If the user provides a value in the constructor, it will be passed into the constructor of the sampling processor. Otherwise, it will fall back to the default behavior and rely on the sampling percentage specified in the config.yaml. Looking forward to you feedback. |
Sounds good @Nikhil172913832 - make sure to propagate it one level up to the traceloop initializer |
Which component is this feature for?
Traceloop SDK
🔖 Feature description
Traces should have support for setting sampling rate.
🎤 Why is this feature needed ?
Sampling rate helps control the trace volume and improves performance for very high throughput or latency sensitive applications. Also, limiting trace volume helps control cost.
✌️ How do you aim to achieve this?
Similar to https://langfuse.com/docs/tracing-features/sampling or via configuration
🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: