update README

This commit is contained in:
Alex Holovach
2025-10-02 15:31:54 -05:00
parent b385007e44
commit 1128db9e88
+21 -6
View File
@@ -2,6 +2,10 @@
OpenTelemetry instrumentation for [Drizzle ORM](https://orm.drizzle.team/). Add distributed tracing to your database queries with a single line of code.
![Drizzle ORM Trace Visualization](../../images/otel-drizzle-trace.png)
*Visualize your database queries with detailed span information including operation type, SQL statements, and performance metrics.*
## Installation
```bash
@@ -59,15 +63,26 @@ const db = instrumentDrizzle(drizzle(sqlite), { dbSystem: "sqlite" });
## What You Get
Each database query automatically creates a span with:
Each database query automatically creates a span with rich telemetry data:
- **Span name**: `drizzle.select`, `drizzle.insert`, `drizzle.update`, etc.
- **SQL operation**: Extracted from query (SELECT, INSERT, UPDATE, DELETE)
- **Full SQL query**: Captured and sanitized (configurable)
- **Error tracking**: Exceptions are recorded with stack traces
- **Database metadata**: System, name, host, and port information
- **Operation type**: `db.operation` attribute (SELECT, INSERT, UPDATE, DELETE)
- **SQL query text**: Full query statement captured in `db.statement` (configurable)
- **Database system**: `db.system` attribute (postgresql, mysql, sqlite, etc.)
- **Error tracking**: Exceptions are recorded with stack traces and proper span status
- **Performance metrics**: Duration and timing information for every query
Follows [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/database/) for database instrumentation.
### Span Attributes
The instrumentation adds the following attributes to each span following [OpenTelemetry semantic conventions](https://opentelemetry.io/docs/specs/semconv/database/):
| Attribute | Description | Example |
|-----------|-------------|---------|
| `db.operation` | SQL operation type | `SELECT` |
| `db.statement` | Full SQL query | `select "id", "name" from "users"...` |
| `db.system` | Database system | `postgresql` |
| `db.name` | Database name | `myapp` |
| `operation.name` | Client operation name | `kubiks_otel-drizzle.client` |
## License