-
Notifications
You must be signed in to change notification settings - Fork 878
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
How do I add a custom SpanSuppressor to an auto instrumented service? #10664
Comments
It is unlikely we'll provide such an api because span suppressor is the wrong abstraction for disabling tracing, it is intended to use to suppress nested spans. See discussion in #10436 |
If I want to implement the Java-agent circuit breaker mechanism, how can I dynamically enable and disable all instrumentations? |
I think first you should consider where exactly do you want to stop the tracing. Agent uses https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation-api for tracing and by convention calls https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation-api/src/main/java/io/opentelemetry/instrumentation/api/instrumenter/Instrumenter.java#L109 before creating a span. If you wish to cut off spans there you'd need to modify that method as there are no extension points that could be used to hook into it. You could also consider using a sampler or perhaps even use a custom exporter that either delegates to otlp exporter (or whatever you normally use) or drops the spans. |
This has been automatically marked as stale because it has been marked as needing author feedback and has not had any activity for 7 days. It will be closed automatically if there is no response from the author within 7 additional days from this comment. |
Is your feature request related to a problem? Please describe.
I want to implement the circuit breaker mechanism, when there is excessive CPU and memory pressure, the tracer stops working. However, it seems that the current API cannot be extended to support Customized SpanSuppressor. It is hoped that relevant APIs can be added to support the implementation of customized SpanSuppressor.
Describe the solution you'd like
It is hoped that relevant APIs can be added to support the implementation of customized SpanSuppressor.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: