by Liam K.

Community-maintained OpenTelemetry instrumentation packages for Node.js and browser, covering 40+ libraries including Express, AWS SDK, GraphQL, Redis, MongoDB, and more. Enables automatic distributed tracing, metrics, and log correlation with zero code changes.
This block provides the community-maintained OpenTelemetry instrumentation packages for Node.js and browser environments, covering auto-instrumentation, span/log processors, propagators, resource detectors, and per-library instrumentations. It is aimed at backend and full-stack engineers who need production-grade observability without maintaining individual OpenTelemetry integrations from scratch.
auto-configuration-propagators/ - Reads OTEL_PROPAGATORS env var and returns the configured composite propagatorauto-instrumentations-node/ - Meta-package that registers all supported Node.js instrumentations in one callauto-instrumentations-web/ - Meta-package that registers all supported browser instrumentations in one callbaggage-log-record-processor/ - Log record processor that copies OpenTelemetry Baggage entries onto every log recordbaggage-span-processor/ - Span processor that copies OpenTelemetry Baggage entries onto every spancontrib-test-utils/ - Shared test utilities used across the contrib packageshost-metrics/ - Collects CPU, memory, and network metrics from the hostid-generator-aws-xray/ - Generates trace IDs compatible with AWS X-Ray formatinstrumentation-amqplib/ - Instruments RabbitMQ via amqplibinstrumentation-aws-lambda/ - Instruments AWS Lambda handlersinstrumentation-aws-sdk/ - Instruments AWS SDK v2 and v3 callsinstrumentation-browser-navigation/ - Instruments browser navigation timinginstrumentation-bunyan/ - Instruments Bunyan logger for log correlationinstrumentation-cassandra-driver/ - Instruments cassandra-driver queriesinstrumentation-connect/ - Instruments Connect middleware frameworkinstrumentation-cucumber/ - Instruments Cucumber test frameworkinstrumentation-dataloader/ - Instruments DataLoader batching and cachinginstrumentation-dns/ - Instruments Node.js dns module lookupsinstrumentation-document-load/ - Instruments browser document load lifecycleinstrumentation-express/ - Instruments Express.js routing and middlewareSpin up an isolated sandbox and run it server-side — no local setup.
Tetrees AI Review of this version
This TypeScript cli / script completed archive review with strong static results. Structure, dependency manifests, documentation, functional source, and common risk patterns were checked by the Tetrees verification pipeline; runtime phases are stated separately.
Deterministic AVCP artifact review
Pipeline avcp-2026-08-04.1 · SHA-256 386de6fb6515284b…
This version-scoped review deterministically inspects the submitted archive for structure, dependencies, documentation, functional source, and common malicious or high-risk signals. Build and test phases are reported as passed only after an isolated sandbox audition. It is not a guarantee of perfect security.
Reviewed Aug 4, 2026
Push this product straight into your AI IDE, web builder or cloud IDE.
Connect Tetrees to a compatible AI IDE, list products you own, and request the verified ZIP without exposing seller upload controls.
No reviews yet.
Sign in to join the discussion
Loading discussion…
instrumentation-fs/ - Instruments Node.js fs module operationsinstrumentation-generic-pool/ - Instruments generic-pool resource poolsinstrumentation-graphql/ - Instruments GraphQL query executioninstrumentation-hapi/ - Instruments Hapi.js server routesinstrumentation-ioredis/ - Instruments ioredis Redis clientinstrumentation-kafkajs/ - Instruments KafkaJS producer and consumerinstrumentation-knex/ - Instruments Knex.js query builderinstrumentation-koa/ - Instruments Koa.js middlewareinstrumentation-langchain/ - Instruments LangChain LLM callsinstrumentation-long-task/ - Instruments browser Long Tasks APIinstrumentation-lru-memoizer/ - Instruments lru-memoizer cachinginstrumentation-memcached/ - Instruments Memcached client callsinstrumentation-mongodb/ - Instruments MongoDB driver operationsinstrumentation-mongoose/ - Instruments Mongoose ODM queriesinstrumentation-mysql/ - Instruments mysql driver queriesinstrumentation-mysql2/ - Instruments mysql2 driver queriesinstrumentation-nestjs-core/ - Instruments NestJS core moduleinstrumentation-net/ - Instruments Node.js net module TCP connectionsinstrumentation-openai/ - Instruments OpenAI SDK callsinstrumentation-oracledb/ - Instruments oracledb driver queriesinstrumentation-pg/ - Instruments node-postgres (pg) queriesinstrumentation-pino/ - Instruments Pino logger for log correlationinstrumentation-redis/ - Instruments redis v2/v3 clientinstrumentation-redis-4/ - Instruments redis v4 clientinstrumentation-restify/ - Instruments Restify framework routesinstrumentation-router/ - Instruments the router packageinstrumentation-runtime-node/ - Collects Node.js runtime metrics (event loop, GC)instrumentation-sequelize/ - Instruments Sequelize ORM queriesinstrumentation-socket.io/ - Instruments Socket.IO emit and on eventsinstrumentation-tedious/ - Instruments Tedious SQL Server clientinstrumentation-typeorm/ - Instruments TypeORM queriesinstrumentation-undici/ - Instruments undici HTTP clientinstrumentation-user-interaction/ - Instruments browser user interaction eventsinstrumentation-web-exception/ - Instruments uncaught browser exceptionsinstrumentation-winston/ - Instruments Winston logger for log correlationplugin-react-load/ - Instruments React component load timingpropagation-utils/ - Shared utilities for context propagationpropagator-aws-xray/ - AWS X-Ray trace context propagatorpropagator-aws-xray-lambda/ - AWS X-Ray propagator tuned for Lambdapropagator-instana/ - Instana trace context propagatorpropagator-ot-trace/ - OpenTracing trace context propagatorredis-common/ - Shared utilities for Redis instrumentationsresource-detector-alibaba-cloud/ - Detects Alibaba Cloud resource attributesresource-detector-aws/ - Detects AWS resource attributes (EC2, ECS, EKS, Lambda)resource-detector-azure/ - Detects Azure resource attributesresource-detector-container/ - Detects container resource attributes from cgroupsresource-detector-gcp/ - Detects Google Cloud resource attributesresource-detector-github/ - Detects GitHub Actions resource attributesresource-detector-instana/ - Detects Instana agent resource attributessampler-aws-xray/ - AWS X-Ray centralized samplingsql-common/ - Shared utilities for SQL instrumentationswinston-transport/ - OpenTelemetry log transport for Winstonnpm install @opentelemetry/api \
@opentelemetry/sdk-node \
@opentelemetry/sdk-trace-node \
@opentelemetry/sdk-logs \
@opentelemetry/resources \
@opentelemetry/semantic-conventions \
@opentelemetry/exporter-trace-otlp-http \
@opentelemetry/exporter-logs-otlp-http
No native build steps are required. Individual instrumentation packages (e.g., instrumentation-pg, instrumentation-mongodb) may require that the library being instrumented is also installed separately.
source/ directory into your project root, e.g. ./otel-contrib/.tsconfig.json if you want to import from sub-packages directly:{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@otel-contrib/*": ["otel-contrib/*/src"]
}
}
}
tracing.ts file that is required before any other module (use Node.js -r flag or import it first in index.ts).OTEL_SERVICE_NAME=my-service
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
OTEL_PROPAGATORS=tracecontext,baggage
tracing.ts is loaded before any instrumented library (Express, pg, etc.) is required.import { getPropagator } from './otel-contrib/auto-configuration-propagators/src';
function getPropagator(): TextMapPropagator
Reads the OTEL_PROPAGATORS environment variable, instantiates each named propagator, and returns a CompositePropagator. Use this when you want env-driven propagator selection without hard-coding propagator classes.
import {
getNodeAutoInstrumentations,
InstrumentationConfigMap,
} from './otel-contrib/auto-instrumentations-node/src';
function getNodeAutoInstrumentations(
inputConfigs?: InstrumentationConfigMap
): Instrumentation[]
Returns an array of all supported Node.js Instrumentation instances, ready to pass to the OpenTelemetry SDK. Use InstrumentationConfigMap to enable, disable, or configure individual instrumentations by their package name key.
import { getResourceDetectors } from './otel-contrib/auto-instrumentations-node/src';
function getResourceDetectors(): DetectorSync[]
Reads OTEL_NODE_RESOURCE_DETECTORS and returns the matching resource detector instances. Use this to populate resourceDetectors in NodeSDK options so the SDK automatically discovers cloud and container attributes at startup.
import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from './otel-contrib/baggage-span-processor/src';
import type { BaggageKeyPredicate } from './otel-contrib/baggage-span-processor/src';
class BaggageSpanProcessor implements SpanProcessor {
constructor(baggageKeyPredicate: BaggageKeyPredicate) {}
}
Attaches Baggage entries as span attributes on every span start. Pass ALLOW_ALL_BAGGAGE_KEYS to copy all keys, or supply a predicate function (key: string) => boolean to filter which keys are propagated.
import { BaggageLogRecordProcessor, ALLOW_ALL_BAGGAGE_KEYS } from './otel-contrib/baggage-log-record-processor/src';
import type { BaggageKeyPredicate } from './otel-contrib/baggage-log-record-processor/src';
class BaggageLogRecordProcessor implements LogRecordProcessor {
constructor(baggageKeyPredicate: BaggageKeyPredicate) {}
}
Attaches Baggage entries as log record attributes. Use it in a LoggerProvider to ensure every log emitted carries the same Baggage context that spans carry.
import {
getWebAutoInstrumentations,
InstrumentationConfigMap,
} from './otel-contrib/auto-instrumentations-web/src';
function getWebAutoInstrumentations(
inputConfigs?: InstrumentationConfigMap
): Instrumentation[]
Returns all supported browser instrumentations. Pass the result to a WebTracerProvider's registerInstrumentations helper. Use InstrumentationConfigMap to disable specific instrumentations such as @opentelemetry/instrumentation-document-load.
Initialize OpenTelemetry once at process start, using env-driven propagators and auto-detected resources.
// tracing.ts (import this first in index.ts or use -r flag)
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { getNodeAutoInstrumentations, getResourceDetectors } from './otel-contrib/auto-instrumentations-node/src';
import { getPropagator } from './otel-contrib/auto-configuration-propagators/src';
const sdk = new NodeSDK({
traceExporter: new OTLPTraceExporter(),
instrumentations: getNodeAutoInstrumentations({
'@opentelemetry/instrumentation-fs': { enabled: false },
}),
resourceDetectors: getResourceDetectors(),
textMapPropagator: getPropagator(),
});
sdk.start();
process.on('SIGTERM', () => {
sdk.shutdown().then(() => process.exit(0));
});
Add Baggage values (e.g. tenant ID) set in incoming request middleware so they appear on every span and log record automatically.
import { NodeSDK } from '@opentelemetry/sdk-node';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
import { OTLPLogExporter } from '@opentelemetry/exporter-logs-otlp-http';
import { LoggerProvider, SimpleLogRecordProcessor } from '@opentelemetry/sdk-logs';
import { BaggageSpanProcessor, ALLOW_ALL_BAGGAGE_KEYS } from './otel-contrib/baggage-span-processor/src';
import { BaggageLogRecordProcessor } from './otel-contrib/baggage-log-record-processor/src';
import { getNodeAutoInstrumentations } from './otel-contrib/auto-instrumentations-node/src';
const loggerProvider = new LoggerProvider();
loggerProvider.addLogRecordProcessor(
new BaggageLogRecordProcessor(ALLOW_ALL_BAGGAGE_KEYS)
);
loggerProvider.addLogRecordProcessor(
new SimpleLogRecordProcessor(new OTLPLogExporter())
);
const sdk = new NodeSDK({
traceExporter: new OTLPTraceExporter(),
spanProcessors: [new BaggageSpanProcessor(ALLOW_ALL_BAGGAGE_KEYS)],
instrumentations: getNodeAutoInstrumentations(),
});
sdk.start();
Only propagate Baggage entries whose keys start with tenant. to avoid leaking internal headers onto spans.
import { BaggageSpanProcessor } from './otel-contrib/baggage-span-processor/src';
import type { BaggageKeyPredicate } from './otel-contrib/baggage-span-processor/src';
const tenantKeyOnly: BaggageKeyPredicate = (key: string) =>
key.startsWith('tenant.');
const processor = new BaggageSpanProcessor(tenantKeyOnly);
// Register processor with your TracerProvider:
// tracerProvider.addSpanProcessor(processor);
Set up browser tracing, disabling the long-task instrumentation which can be noisy in single-page apps.
import { WebTracerProvider } from '@opentelemetry/sdk-trace-web';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { getWebAutoInstrumentations } from './otel-contrib/auto-instrumentations-web/src';
const provider = new WebTracerProvider();
provider.register();
registerInstrumentations({
instrumentations: getWebAutoInstrumentations({
'@opentelemetry/instrumentation-long-task': { enabled: false },
}),
tracerProvider: provider,
});
auto-configuration-propagators/ - Exports getPropagator() which reads OTEL_PROPAGATORS and constructs a composite propagator; entry in src/index.ts, logic in src/utils.ts.auto-instrumentations-node/ - Exports getNodeAutoInstrumentations and getResourceDetectors; aggregates all Node.js-compatible instrumentation packages into a single factory.auto-instrumentations-web/ - Exports getWebAutoInstrumentations; aggregates all browser-compatible instrumentation packages.baggage-log-record-processor/ - BaggageLogRecordProcessor class plus ALLOW_ALL_BAGGAGE_KEYS constant and BaggageKeyPredicate type for filtering Baggage onto log records.baggage-span-processor/ - BaggageSpanProcessor class plus ALLOW_ALL_BAGGAGE_KEYS constant and BaggageKeyPredicate type for filtering Baggage onto spans.contrib-test-utils/ - Internal test helpers; not intended for production use.host-metrics/ - Periodic collection of host-level CPU, memory, and network metrics via OpenTelemetry Metrics API.id-generator-aws-xray/ - Implements IdGenerator interface producing X-Ray-compatible 96-bit trace IDs.instrumentation-*/ - Individual library instrumentations; each follows the same InstrumentationBase pattern and is configured via InstrumentationConfig.propagation-utils/ - Helper functions shared by propagator packages for header parsing and serialization.propagator-*/ - Concrete TextMapPropagator implementations for various vendor and standard formats.redis-common/ and sql-common/ - Internal shared utilities for Redis and SQL instrumentation packages respectively.resource-detector-*/ - DetectorSync implementations that add cloud/container/CI attributes to the OpenTelemetry Resource.sampler-aws-xray/ - Sampler implementation delegating to AWS X-Ray centralized sampling rules.winston-transport/ - A Winston transport that emits log records into the OpenTelemetry Logs SDK.plugin-react-load/ - Instruments React component render timing via browser performance marks.tracing.ts imported too late: If any instrumented library (e.g., express, pg) is required before the SDK starts, its module is already loaded and monkey-patching is skipped. Fix: ensure tracing.ts is the very first import or use node -r ./tracing.js.OTEL_PROPAGATORS not set: getPropagator() falls back to a no-op propagator if the env var is absent or contains an unrecognized name. Fix: set OTEL_PROPAGATORS=tracecontext,baggage explicitly."type": "module", you must either use a .cjs wrapper or configure your bundler's resolve.extensionAlias. Fix: add "moduleResolution": "node16" in tsconfig.json and use .js extensions in imports.@opentelemetry/api. Using mismatched API versions causes a no-op tracer. Fix: ensure a single @opentelemetry/api version is installed (npm ls @opentelemetry/api) and deduplicate if needed.BaggageSpanProcessor with no Baggage in context: If Baggage is not set on the active context before the span starts, no attributes are added. Fix: use propagation.setBaggage(context.active(), baggage) in your middleware before creating spans.OTEL_NODE_RESOURCE_DETECTORS=env,host,process locally.I have the OpenTelemetry JS Contrib instrumentation source code in the `source/` directory
of my project. I also have a USAGE.md that documents all exports and patterns.
Upstream package: user@example.com
Source directory: ./source/
Documentation: ./USAGE.md
My project is a Node.js TypeScript Express application using PostgreSQL (pg) and Redis (ioredis).
Please help me integrate OpenTelemetry step by step:
1. Create a `tracing.ts` file that starts the NodeSDK using `getNodeAutoInstrumentations`
from `source/auto-instrumentations-node/src` and `getPropagator` from
`source/auto-configuration-propagators/src`.
2. Add a `BaggageSpanProcessor` from `source/baggage-span-processor/src` that copies
all Baggage keys onto spans.
3. Wire `tracing.ts` as the first import in `index.ts`.
4. Set the required environment variables in a `.env.example` file.
5. Show me how to verify spans are being emitted using the OTLP HTTP exporter.
Use only the exports documented in USAGE.md and visible in the source files.
Do not invent any APIs. Show complete, runnable TypeScript files.
This source is distributed under the Apache License 2.0. See source/auto-configuration-propagators/LICENSE or any per-package LICENSE file for the full text.
Upstream repository: open-telemetry/opentelemetry-js-contrib
Upstream package: user@example.com
This product’s unique contribution is clean room implementation of valuable code block into AVCP compatible standard.
The full install guide and integration prompts unlock after purchase.
Automation, Utilities & Developer Tools
Free