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

How do I add a custom SpanSuppressor to an auto instrumented service? #10664

Closed
tianlin opened this issue Feb 26, 2024 · 4 comments
Closed
Labels
needs author feedback Waiting for additional feedback from the author stale

Comments

@tianlin
Copy link

tianlin commented Feb 26, 2024

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

@tianlin tianlin added enhancement New feature or request needs triage New issue that requires triage labels Feb 26, 2024
@laurit
Copy link
Contributor

laurit commented Feb 26, 2024

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

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Feb 26, 2024
@tianlin
Copy link
Author

tianlin commented Feb 27, 2024

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?

@github-actions github-actions bot removed the needs author feedback Waiting for additional feedback from the author label Feb 27, 2024
@laurit
Copy link
Contributor

laurit commented Feb 27, 2024

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.

@steverao steverao added needs author feedback Waiting for additional feedback from the author and removed enhancement New feature or request needs triage New issue that requires triage labels Feb 28, 2024
Copy link
Contributor

github-actions bot commented Mar 6, 2024

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.

@github-actions github-actions bot added the stale label Mar 6, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs author feedback Waiting for additional feedback from the author stale
Projects
None yet
Development

No branches or pull requests

3 participants