opentelemetry-instrumentation-fetch-node
OpenTelemetry Node 18+ native fetch automatic instrumentation package
Last updated 2 years ago by djmax .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install opentelemetry-instrumentation-fetch-node 
SYNC missed versions from official npm registry.

opentelemetry-instrumentation-fetch-node

TypeScript

main CI

npm version

OpenTelemetry Node 18+ native fetch automatic instrumentation package.

Existing instrumentation packages (like @opentelemetry/instrumentation-http) do not work with Node 18+ native fetch, which is based on the undici module but packaged in a "strange" way (some sort of internal bundle that I don't really understand). This module uses the new Node diagnostics channel to instrument native fetch.

Note that due to the fact that fetch is lazy loaded in Node, this module will kick off a "phony" fetch to an unparseable URL (blank string) to get the library to load so we don't miss any events (because the diagnostics channel would not yet exist).

See the tests for an example setup - note the onRequest event that allows you to add outbound headers or span attributes or what have you.

Current Tags

  • 1.2.3                                ...           latest (2 years ago)

5 Versions

  • 1.2.3                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           3 years ago

Copyright 2013 - present © cnpmjs.org | Home |