@aspecto/opentelemetry-plugin-kafka-node
TypeScript icon, indicating that this package has built-in type declarations

0.0.72 • Public • Published

OpenTelemetry kafka-node Instrumentation for Node.js

This module provides automatic instrumentation for kafka-node.

Installation

npm install --save @aspecto/opentelemetry-plugin-kafka-node

Usage

To load a specific plugin (kafka-node in this case), specify it in the Node Tracer's configuration

const { NodeTracerProvider } = require('@opentelemetry/node');

const provider = new NodeTracerProvider({
  plugins: {
    'kafka-node': {
      enabled: true,
      // You may use a package name or absolute path to the file.
      path: '@aspecto/opentelemetry-plugin-kafka-node',
    }
  }
});

kafka-node Plugin Options

kafka-node plugin has few options available to choose from. You can set the following:

Options Type Description
producerHook KafkaProducerCustomAttributeFunction Hook called before producer message is sent, which allow to add custom attributes to span.
consumerHook KafkaConsumerCustomAttributeFunction Hook called before consumer message is processed, which allow to add custom attributes to span.

Known Issues

  • This library instrument only the Producer and Consumer.
  • Due to the lack of support in kafka-node in message headers, there is currently no context propagation between producers and consumers.

Readme

Keywords

none

Package Sidebar

Install

npm i @aspecto/opentelemetry-plugin-kafka-node

Weekly Downloads

41

Version

0.0.72

License

Apache-2.0

Unpacked Size

26.8 kB

Total Files

16

Last publish

Collaborators

  • habmic
  • amir.aspecto
  • aspecto-release-bot
  • andriy-aspecto
  • yanivd