Option / documentation to filter out sentry internal transactions from default Opentelemetry export
Problem Statement
When using sentry-opentelemetry-agent while intentionaly keeping the main (otlp) exporter, in my traces panel I see a lot of internal sentry requests performed multiple times per second. I would prefer a simple way to disable it, especially when it's not SENTRY_DEBUG.
I've tried sentry-opentelemetry-agentcustomization but it kind of lacks documentation:
- adding it as a runtime dependency doesn't seem to change the behavior
- adding it as yet another java agent doesn't work:
Error occurred during initialization of VM
agent library failed Agent_OnLoad: instrument
Failed to find Premain-Class manifest attribute in /opt/docker/bin/../sentry-opentelemetry-agentcustomization/sentry-opentelemetry-agentcustomization-8.0.0-alpha.1.jar
Solution Brainstorm
Add a boolean property and env var like sentry.internal.otel-export andSENTRY_INTERNAL_OTEL_EXPORT
Thanks for opening this issue @ivan-klass, we're currently in the process of reworking our OpenTelemetry Agent. I think it should be enough to simply use SamplingDecision.DROP in OpenTelemetry Sampler when we detect an internal Sentry span. Would you agree?
@adinauer thanks! Sounds good. Waiting for the next 8.x.x jar (8.0.0-alpha.2 ?) so I can verify
Hey @ivan-klass, we've just released 8.0.0-alpha.2 of the Java SDK, there's instructions how to upgrade in the changelog. If you decide to give it a try, any feedback is welcome 🙏 .
@adinauer Hi! Thanks! Just checked the new JAR an here's what I see:
If I don't touch OTEL_LOGS_EXPORTER, I now see warnings like
WARN io.opentelemetry.exporter.internal.grpc.GrpcExporter - Failed to export logs. Server responded with gRPC status code 2
But if I set OTEL_LOGS_EXPORTER=none
It seems like Sentry traces become broken - it has only the outer span and expanding them says there's nothing more
Empty — Transaction did not report any span data
Thanks for the feedback @ivan-klass, that's odd. I'm not sure how Sentry and OTEL_LOGS_EXPORTER are linked.
What version of the sentry-opentelemetry-agent did you test with?
We found some bugs and are about to release alpha 4 soon. Maybe that'll fix this too.
@ivan-klass we've just released https://github.com/getsentry/sentry-java/releases/tag/8.0.0-alpha.4, can you please retest?
@adinauer now everything seems fine, thank you guys!