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

@opentelemetry/instrumentation-http should have an option to suppress tracing on ignored outgoing requests #4926

Open
Bruno-DaSilva opened this issue Aug 18, 2024 · 2 comments

Comments

@Bruno-DaSilva
Copy link

Bruno-DaSilva commented Aug 18, 2024

Is your feature request related to a problem? Please describe.

As mentioned in #3235, instrumentation-dns and instrumentation-net will create spans after an http span has been ignored. As a result, you're left with tls/tcp/dns spans that are essentially parentless (their parent is the http span's original parent before it was ignored).
This adds a lot of noise in our traces, and there doesn't seem to be a good way to identify these spans and remove them.

Describe the solution you'd like

I'd love it if @opentelemetry-http had some sort of option that did a suppressTracing on this line

return original.apply(this, [optionsParsed, ...args]);
similar to what was done previously in incoming spans here: #1831

Describe alternatives you've considered

I've looked into all available hooks on @opentelemetry/instrumentation-http and none of them can result in a suppressTracing behaviour to block the child spans from being sent.

I've tried to identify the net/dns spans in a Sampler, but there's no good way to know if they were spans part of a request i wanted to ignore or part of a request i wanted to keep (because it depends on parent information that's missing when i ignore an http span).

I've looked into using a SpanProcessor but that doesn't really work well to drop spans as far as I can tell - you can drop spans before export I'm sure, but done wrong it can mess up the tree of spans

It may be possible to climb the parents to the http call IF the http span is not ignored, and drop all the http, net, and dns spans that are associated with it in a span processor or sampler, BUT that will mean that propagation injection is on (since the http request is not ignored in order to generate the span) so that will cause children services to behave differently.

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Oct 28, 2024
@Bruno-DaSilva
Copy link
Author

still open

@github-actions github-actions bot removed the stale label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant