Skip to content

Supressed spans get injected #2067

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

Closed
Flarna opened this issue Mar 31, 2021 · 7 comments · Fixed by #2082
Closed

Supressed spans get injected #2067

Flarna opened this issue Mar 31, 2021 · 7 comments · Fixed by #2082
Labels
bug Something isn't working

Comments

@Flarna
Copy link
Member

Flarna commented Mar 31, 2021

What version of OpenTelemetry are you using?

0.18.2

What version of Node are you using?

14.16.0

Please provide the code you used to setup the OpenTelemetry SDK

const tp = new NodeTracerProvider();
tp.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({ serviceName: "Foo" })));
tp.register();

What did you do?

Create spans and watch HTTP messages sent by exporter

What did you expect to see?

HTTP messages without traceparent HTTP header

What did you see instead?

HTTP messages contain traceparent HTTP header even the span for the HTTP operation is suppressed.

Additional context

Add any other context about the problem here.

@Flarna Flarna added the bug Something isn't working label Mar 31, 2021
@dyladan
Copy link
Member

dyladan commented Apr 7, 2021

To be clear, this is saying the trace context is injected but not that they're actually traced and exported (infinite loop) correct?

@Flarna
Copy link
Member Author

Flarna commented Apr 7, 2021

The traceparent, tracestate headers are added to the HTTP requests exporting data to zipkin.
The spans itself are suppressed as expected. traceId/spanId from the place where export is called are used.

@dyladan
Copy link
Member

dyladan commented Apr 7, 2021

I suggest we update the propagators to check the context for isSuppressed

@Flarna
Copy link
Member Author

Flarna commented Apr 7, 2021

Another option would be to adapt suppressInstrumentation() to use ROOT_CONTEXT instead context.active() as base.
But well, this would likely break unsuppressInstrumentation()... or at least modify it's behavior.

@dyladan
Copy link
Member

dyladan commented Apr 7, 2021

so a suppressed instrumentation would always be empty?

I think this could be confusing. If suppressing a context returns an empty context, nothing stops the user from adding new properties to it later on. Having some properties missing and others not would be hard to debug for users who didn't know what was going on.

@Flarna
Copy link
Member Author

Flarna commented Apr 7, 2021

Yep, agree that your proposal fits better.

@dyladan
Copy link
Member

dyladan commented Apr 7, 2021

More work and more places to mess up unfortunately, but it's more straightforward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants