Registry / database / autotel-drizzle

autotel-drizzle

JSON →
library0.0.26jsnpmunverified

OpenTelemetry instrumentation for Drizzle ORM, version 0.0.26. Provides automatic tracing of Drizzle ORM queries for observability. Part of the autotel ecosystem, it integrates with OpenTelemetry to capture spans for database operations. Supports Drizzle ORM >=0.45.2. Currently in early development with frequent releases.

npm install autotel-drizzle
INSTALL
IMPORT
SIG · AUTOTEL-DRIZZLE
A
autotel-drizzle
databasejavascriptv0.0.26
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AutotelDrizzle
import { AutotelDrizzle } from 'autotel-drizzle'
const AutotelDrizzle = require('autotel-drizzle')
ESM-only package; named export.
createInstrumentation
import { createInstrumentation } from 'autotel-drizzle'
import createInstrumentation from 'autotel-drizzle'
Named export, not default.
default
import autotelDrizzle from 'autotel-drizzle'
const { default } = require('autotel-drizzle')
Default export available as convenience; may be deprecated in future.

Sets up OpenTelemetry with autotel-drizzle to automatically trace Drizzle ORM queries.

import { AutotelDrizzle } from 'autotel-drizzle'; import { drizzle } from 'drizzle-orm/node-postgres'; import { Pool } from 'pg'; import { OTelSpanExporter } from '@opentelemetry/exporter-trace-otlp-http'; import { NodeSDK } from '@opentelemetry/sdk-node'; const sdk = new NodeSDK({ traceExporter: new OTelSpanExporter(), instrumentations: [new AutotelDrizzle()], }); sdk.start(); const pool = new Pool({ connectionString: process.env.DATABASE_URL ?? '' }); const db = drizzle(pool); async function main() { await db.select().from('users').execute(); await sdk.shutdown(); } main().catch(console.error);
Debug
Known issues
gotchaRequires OpenTelemetry SDK to be initialized before using Drizzle ORM to capture spans.
fix
Ensure SDK.start() is called before any Drizzle queries.
affects: >=0.0.1
deprecatedDefault export may be removed in future versions in favor of named exports.
fix
Use named import { AutotelDrizzle } instead of default import.
affects: >=0.0.20
breakingVersion 0.0.26 changed instrumentation API; previously used 'InstrumentDrizzle'.
fix
Update imports to use 'AutotelDrizzle' class.
affects: >=0.0.26
Errors
Common errors & fixes
Error: Module not found: Can't resolve 'autotel-drizzle'
Package not installed or missing dependency.
fix
Run 'npm install autotel-drizzle' as a dependency.
TypeError: autotel_drizzle_1.AutotelDrizzle is not a constructor
Using default import when named import is required.
fix
Use 'import { AutotelDrizzle } from 'autotel-drizzle'' instead of 'import AutotelDrizzle from 'autotel-drizzle''.
OpenTelemetry: No active span. Make sure SDK is started.
SDK not started before Drizzle queries.
fix
Call 'sdk.start()' before using Drizzle ORM.
Upgrade
Version history
0.0.26latest on npm
Audit
Dependencies
drizzle-ormrequiredpeer dependency required for instrumentation to work with Drizzle ORM >=0.45.2
Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
autotel-drizzle — npm install autotel-drizzle · libregistry