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 { instrumentBigQueryClient } from 'autotel-plugins/bigquery';
const client = instrumentBigQueryClient(new BigQuery());
// All queries are now traced with SQL text, dataset, and job metadataconst [rows] = await client.query('SELECT * FROM mydataset.mytable');Kafka (Batch Consumer)
Section titled “Kafka (Batch Consumer)”For KafkaJS eachBatch consumers with per-message spans:
import { withBatchConsumer, createMessageErrorSpan,} from 'autotel-plugins/kafka';
consumer.run({ eachBatch: withBatchConsumer({ destination: 'user-events', consumerGroup: 'event-processor', })(async ({ batch, heartbeat }) => { for (const message of batch.messages) { // Each message gets its own span linked to producer trace await processMessage(message); } }),});RabbitMQ
Section titled “RabbitMQ”import { instrumentRabbitMQ } from 'autotel-plugins/rabbitmq';
// Instrument channel for publish/consume tracingconst instrumentedChannel = instrumentRabbitMQ(channel);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— Kafka batch consumerautotel-plugins/rabbitmq— RabbitMQ instrumentation