Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opentelemetry/instrumentation

Package Overview
Dependencies
Maintainers
4
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/instrumentation

Base class for node which OpenTelemetry instrumentation modules extend

  • 0.25.1-alpha.13
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15M
increased by12.7%
Maintainers
4
Weekly downloads
 
Created

What is @opentelemetry/instrumentation?

The @opentelemetry/instrumentation package is part of the OpenTelemetry project, which aims to provide a unified and standardized observability framework for monitoring applications' performance and behavior. This particular package offers a way to automatically instrument code to collect telemetry data such as traces and metrics, making it easier to monitor and debug applications.

What are @opentelemetry/instrumentation's main functionalities?

Automatic Instrumentation

Automatically instruments Node.js applications to collect telemetry data, such as tracing information for HTTP requests. This example shows how to set up the NodeTracerProvider and register the HttpInstrumentation to start collecting data.

const { NodeTracerProvider } = require('@opentelemetry/sdk-trace-node');
const { registerInstrumentations } = require('@opentelemetry/instrumentation');
const { HttpInstrumentation } = require('@opentelemetry/instrumentation-http');

const provider = new NodeTracerProvider();

registerInstrumentations({
  instrumentations: [
    new HttpInstrumentation()
  ],
  tracerProvider: provider,
});

Custom Instrumentation

Enables the creation of custom instrumentation for any library or application code not covered by the existing instrumentations. This example demonstrates how to extend the InstrumentationBase class to create a custom instrumentation.

const { InstrumentationBase } = require('@opentelemetry/instrumentation');

class MyCustomInstrumentation extends InstrumentationBase {
  constructor() {
    super('MyCustomInstrumentation');
  }

  init() {
    // Custom initialization logic
  }
}

Other packages similar to @opentelemetry/instrumentation

Keywords

FAQs

Package last updated on 30 Aug 2021

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