New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

opentelemetry-instrumentation-kafkajs

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opentelemetry-instrumentation-kafkajs

open telemetry instrumentation for the `kafkajs` kafka client

  • 0.41.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
112K
decreased by-5.12%
Maintainers
1
Weekly downloads
 
Created
Source

OpenTelemetry kafkajs Instrumentation for Node.js

NPM version

This module provides automatic instrumentation for kafkajs.

Installation

npm install --save opentelemetry-instrumentation-kafkajs

Usage

For further automatic instrumentation instruction see the @opentelemetry/instrumentation package.

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

const tracerProvider = new NodeTracerProvider({
  // be sure to disable old plugin
  plugins: {
    kafkajs: { enabled: false, path: 'opentelemetry-plugin-kafkajs' }
  }
});

registerInstrumentations({
  tracerProvider,
  instrumentations: [
    new KafkaJsInstrumentation({
      // see under for available configuration
    })
  ]
});

kafkajs Instrumentation Options

kafkajs instrumentation has few options available to choose from. You can set the following:

OptionsTypeDescription
producerHookKafkaProducerCustomAttributeFunctionHook called before producer message is sent, which allow to add custom attributes to span.
consumerHookKafkaConsumerCustomAttributeFunctionHook called before consumer message is processed, which allow to add custom attributes to span.
moduleVersionAttributeNamestringIf passed, a span attribute will be added to all spans with key of the provided moduleVersionAttributeName and value of the patched module version

This extension (and many others) was developed by Aspecto with ❤️

Keywords

FAQs

Package last updated on 21 May 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