# opentelemetry-propagator-selective

> selective control on inject / extract enabled on another propagator

Latest version **0.31.0** (published 2024-05-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install opentelemetry-propagator-selective
pnpm add opentelemetry-propagator-selective
yarn add opentelemetry-propagator-selective
bun add opentelemetry-propagator-selective
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.31.0 |
| Published | 2024-05-21 |
| First published | 2021-12-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | aspecto-release-bot |
| Keywords | opentelemetry, propagation |

## Links

- npm: https://www.npmjs.com/package/opentelemetry-propagator-selective
- Homepage: https://github.com/aspecto-io/opentelemetry-propagator-selective
- Issues: https://github.com/aspecto-io/opentelemetry-ext-js/issues
- npm.io page: https://npm.io/package/opentelemetry-propagator-selective

## Recent versions

- 0.31.0 (latest) — 2024-05-21
- 0.0.0-2024-05-16--12-47 (alpha) — 2024-05-16
- 0.30.0 — 2023-10-17
- 0.0.0-2023-10-17--13-06 — 2023-10-17
- 0.0.0-2023-07-26--14-48 — 2023-07-26
- 0.0.0-2022-07-11--08-09 — 2022-07-11
- 0.29.0 — 2022-06-02
- 0.28.1 — 2022-04-13
- 0.0.0-2022-04-13--14-32 — 2022-04-13
- 0.28.0 — 2021-12-27
- 0.0.0-2021-12-26--12-31 — 2021-12-26

## README

# OpenTelemetry Propagator Selective for Node.js
[![NPM version](https://img.shields.io/npm/v/opentelemetry-propagator-selective.svg)](https://www.npmjs.com/package/opentelemetry-propagator-selective)

This module provides [TextMapPropagator](https://github.com/open-telemetry/opentelemetry-js-api/blob/80d617b1f2a6807a11497951d1c63daf6a5fe705/src/propagation/TextMapPropagator.ts#L30) which wraps another propagator and apply inject and extract selectively according to configuration. 

## Installation

```bash
npm install --save opentelemetry-propagator-selective
```

##  Usage
Example usage with [B3 Propagator](https://www.npmjs.com/package/@opentelemetry/propagator-b3)

```ts
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`

---
_Source: https://npm.io/package/opentelemetry-propagator-selective · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
