question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fetch instrumentation does not keep original request headers

See original GitHub issue

Please answer these questions before submitting a bug report.

What version of OpenTelemetry are you using?

0.19

What version of Node are you using?

v15.13.0

Please provide the code you used to setup the OpenTelemetry SDK

    const tracerProvider = new WebTracerProvider(config.telemetry.provider)
    tracerProvider.addSpanProcessor(new BatchSpanProcessor(new ZipkinExporter(config.telemetry.exporter)))
    tracerProvider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()))
    registerInstrumentations({
        instrumentations: [new DocumentLoadInstrumentation(), new FetchInstrumentation()],
        tracerProvider,
    })
    tracerProvider.register({ contextManager: new ZoneContextManager() })

What did you do?

Nothing more than installing the packages and adding the above snippet imported at the entrypoint of the application.

repro project

What did you expect to see?

Original request headers (notably a x-authorization header for authenticated requests) to be left in the instrumented request.

What did you see instead?

Original request headers are stripped, only the traceparent header is present.

Additional context

The fetch instrumentation is preventing any and all authenticated requests (which, given the application I’m working on, is all of them).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
SaschaBrechmannVHVcommented, Nov 11, 2022

@dyladan : Do you missing the close? Regards, Sascha

0reactions
dyladancommented, Jul 13, 2022

I think this issue was fixed by #2466 @SolarLiner can you please confirm? If not I will close this issue in a week

Read more comments on GitHub >

github_iconTop Results From Across the Web

fetch() does not send headers? - Stack Overflow
I have disabled service worker. I have tried to create Request and specifically add headers using req.headers.append() . The headers still ...
Read more >
Access-Control-Allow-Headers - HTTP - MDN Web Docs
Although CORS-safelisted request headers are always allowed and don't usually need to be listed in Access-Control-Allow-Headers , listing them ...
Read more >
Manual Instrumentation | OpenTelemetry
The first step is to get a handle to an instance of the OpenTelemetry interface. ... Tell OpenTelemetry to inject the context in...
Read more >
OpenTelemetry Browser Instrumentation - Honeycomb
In this post, I'll walk through getting started on browser instrumentation so you can get answers to any of your questions.
Read more >
Modify Outgoing Request Header - Akamai TechDocs
Use this behavior to decide how selected request headers going upstream towards the origin should be processed. For example, you can add headers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found