Skip to content

Plugins

autotel-plugins instruments libraries that have no official OpenTelemetry package or where official support is broken.

Only includes instrumentation that:

  1. Has NO official OpenTelemetry package
  2. Has BROKEN official instrumentation
  3. Adds significant value beyond official packages
Terminal window
npm install autotel autotel-plugins
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 metadata
const [rows] = await client.query('SELECT * FROM mydataset.mytable');

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);
}
}),
});
import { instrumentRabbitMQ } from 'autotel-plugins/rabbitmq';
// Instrument channel for publish/consume tracing
const instrumentedChannel = instrumentRabbitMQ(channel);
  • example-pg — PostgreSQL with official @opentelemetry/instrumentation-pg and autotel.
  • example-prisma — Prisma ORM with PrismaInstrumentation showing detailed span trees.

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 |

  • autotel-plugins/bigquery — BigQuery instrumentation
  • autotel-plugins/kafka — Kafka batch consumer
  • autotel-plugins/rabbitmq — RabbitMQ instrumentation