Plugins
autotel-plugins instruments libraries that have no official OpenTelemetry package or where official support is broken.
Philosophy
Section titled “Philosophy”Only includes instrumentation that:
- Has NO official OpenTelemetry package
- Has BROKEN official instrumentation
- Adds significant value beyond official packages
Installation
Section titled “Installation”npm install autotel autotel-pluginsBigQuery
Section titled “BigQuery”import { BigQuery } from '@google-cloud/bigquery';import { instrumentBigQuery } from 'autotel-plugins/bigquery';
const client = new BigQuery();instrumentBigQuery(client);
// All queries are now traced with SQL text, dataset, and job metadataconst [rows] = await client.query('SELECT * FROM mydataset.mytable');Kafka has its own package: see Kafka. autotel-plugins/kafka re-exports autotel-kafka and is deprecated.
RabbitMQ
Section titled “RabbitMQ”import { withConsumeSpan } from 'autotel-plugins/rabbitmq';
channel.consume('orders', async (msg) => { if (!msg) return; await withConsumeSpan( { name: 'order.process', headers: msg.properties.headers, contextMode: 'inherit', queue: 'orders', }, async () => { await processOrder(msg); channel.ack(msg); }, );});Examples
Section titled “Examples”example-pg: PostgreSQL with official@opentelemetry/instrumentation-pgand autotel.example-prisma: Prisma ORM withPrismaInstrumentationshowing detailed span trees.
Use Official Packages When Available
Section titled “Use Official Packages When Available”For libraries with working official instrumentation, use those directly:
| Library | Official Package |
|---|---|
| MongoDB | @opentelemetry/instrumentation-mongodb |
| PostgreSQL | @opentelemetry/instrumentation-pg |
| MySQL | @opentelemetry/instrumentation-mysql2 |
| Redis | @opentelemetry/instrumentation-redis |
| Express | @opentelemetry/instrumentation-express |
Entry Points
Section titled “Entry Points”autotel-plugins/bigquery: BigQuery instrumentationautotel-plugins/kafka: deprecated re-export ofautotel-kafkaautotel-plugins/rabbitmq: RabbitMQ instrumentation