-
Notifications
You must be signed in to change notification settings - Fork 821
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
Add instrumentation for fetch
API
#4333
Comments
@dyladan @pichlermarc could you assign this one to me? Thanks :) |
@david-luna Perhaps clarify that this is about Node.js's global |
yeah, it was very short. I've updated with more info :) |
I've reached the dev who shared his I've try another channel if there is no answer in few days |
@djMax thanks on answering on the question about donating the implementation of https://github.com/gas-buddy/service/blob/main/src/telemetry/fetchInstrumentation.ts to this repo. This is the issue we're using to track it's progress. As discussed in the JavaScript SIG (see Dec 13 notes) the goal would be to have a new package named Tasks to be done
I can create a draft PR to start so you can give a 1st review or we could do it the other way around. Up to you. :) |
Happy to review a PR, and to try it out in a place with tests that verify it's function from a consumer perspective. |
This was discussed in the OTel JS SIG today (https://docs.google.com/document/d/1tCyoQK49WVcE-x8oryZOTTToFm7sIeUhxFPm9g-qL1k/edit#heading=h.ry29ajruzxyg). It was concluded to move this instrumentation to the contrib repo. |
Link to the contrib PR: open-telemetry/opentelemetry-js-contrib#1951 |
…` and global `fetch` API (open-telemetry#1951) Closes: open-telemetry/opentelemetry-js#4333 Co-authored-by: Jamie Danielson <[email protected]> Co-authored-by: Trent Mick <[email protected]> Co-authored-by: Marc Pichler <[email protected]>
Is your feature request related to a problem? Please describe.
NodeJS's global
fetch
API is not instrumented therefore we do not get traces for requests made with it and also the tracecontext is not propagated. The lack of this instrumentation may raise more issues like this one #4247 and switching fromfetch
tohttp
or any packages which has an available instrumentation likeundici
may be a no go for the devsThere's a package
@opentelemetry/instrumentation-fetch
but is specific for web platform since its depending@opentelemetry/sdk-trace-web
so we need an instrumetation that fits for nodejs' fetch. There are some questions though.@opentelemetry/instrumentation-node-fetch
could make users think is for node-fetch packageTrying to answer myself to the 1st question I'd say we can not forecast what are the instrumentation needs for each platform. As an example we see in the current code that is taking in consideration CORS preflight requests which is very common in web but not so much in node. So I'd prefer to have a specific instrumentation for nodejs'
fetch
About the naming I do not know if there is a convention so feedback from @dyladan or @pichlermarc would be appreciated :)
Refs: #4247
Describe the solution you'd like
Create a new instrumentation package for nodejs'
fetch
global API and place it in this repository. There is a mention in #3346 of a couple of instrumentations that we could take as a good stating pointIMO 2nd implementation is the way to go since
fetch
is hooking internally toundici
and it won't detected by our require/import hooks. See section below.Describe alternatives you've considered
http
module or a package that could be instrumented.opentelemetry-instrumentation-undici
to check if the internal module is instrumentedSee #4247 (comment)
Additional context
The text was updated successfully, but these errors were encountered: