opentelemetry-propagator-selective
TypeScript icon, indicating that this package has built-in type declarations

0.30.0 • Public • Published

OpenTelemetry Propagator Selective for Node.js

NPM version

This module provides TextMapPropagator which wraps another propagator and apply inject and extract selectively according to configuration.

Installation

npm install --save opentelemetry-propagator-selective

Usage

Example usage with B3 Propagator

import { SelectivePropagator } from 'opentelemetry-propagator-selective';
import { B3Propagator } from '@opentelemetry/propagator-b3';
import { propagation } from '@opentelemetry/api';

const b3ExtractOnly = new SelectivePropagator(new B3Propagator(), { extractEnabled: true, injectEnabled: false});
propagation.setGlobalPropagator(b3ExtractOnly);

You can use any propagator compatible with the TextMapPropagator interface.

Configuration

  • You can set extractEnabled and injectEnabled to boolean values to set which operations are valid.
  • It is possible to set both to true or both to false.
  • If not set, default is to not inject / extract

Package Sidebar

Install

npm i opentelemetry-propagator-selective

Weekly Downloads

1,272

Version

0.30.0

License

Apache-2.0

Unpacked Size

20.1 kB

Total Files

13

Last publish

Collaborators

  • aspecto-release-bot