Socket
Socket
Sign inDemoInstall

opentelemetry-instrumentation-fetch-node

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentelemetry-instrumentation-fetch-node

OpenTelemetry Node 18+ native fetch automatic instrumentation package


Version published
Weekly downloads
1.1M
increased by1.71%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 07 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc