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

HttpTraceContext injects invalid span context #2066

Closed
Flarna opened this issue Mar 31, 2021 · 0 comments · Fixed by #2080
Closed

HttpTraceContext injects invalid span context #2066

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

Comments

@Flarna
Copy link
Member

Flarna commented Mar 31, 2021

Please answer these questions before submitting a bug report.

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 an invalid/NoopSpan and inject it via propagator.

const noopSpan = NOOP_TRACER.startSpan("NoOp");
const carrier = {};
propagation.inject(setSpan(ROOT_CONTEXT, noopSpan), carrier);
console.log(carrier);

What did you expect to see?

Invalid SpanContext get's not injected into carrier.

What did you see instead?

Invalid span context gets injected:

{
  traceparent: '00-00000000000000000000000000000000-0000000000000000-00'
}

Additional context

I know that noop span creation via NOOP_TRACER is not a real world usecase. But NOOP_TRACER is used at several places in SDK therefore this can happen. But my target here was to create a simple reproducer.

@Flarna Flarna added the bug Something isn't working label Mar 31, 2021
@dyladan dyladan self-assigned this Apr 7, 2021
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