OpenTelemetry Database Monitoring
In addition to the eBPF-based Database Access Monitoring (DAM), you can use OpenTelemetry SDK instrumentation to capture detailed database query traces with custom attributes.
How It Works
Section titled “How It Works”OpenTelemetry auto-instrumentation agents and SDKs provide library-specific hooks that capture database operations as trace spans. These spans include:
- SQL query text (sanitized)
- Database system and name
- Operation type (SELECT, INSERT, UPDATE, DELETE)
- Duration and status
- Connection details
When to Use
Section titled “When to Use”- When you need rich, library-specific database query details
- When you want custom attributes on database spans
- When your application already uses OpenTelemetry SDKs
- When combined with Manual Instrumentation for the business context
Supported Database Libraries
Section titled “Supported Database Libraries”| Language | Libraries Auto-Instrumented |
|---|---|
| Java | JDBC, Hibernate, Spring Data |
| Python | SQLAlchemy, psycopg2, PyMySQL, Django ORM |
| Node.js | pg, mysql2, mongoose, Prisma |
| .NET | Entity Framework, Npgsql, MySqlConnector |
| Go | database/sql, GORM, pgx |
Configuration
Section titled “Configuration”Configure your OpenTelemetry SDK to export to the KloudMate Agent OTLP endpoint:
Database spans will automatically be captured when using supported auto-instrumentation libraries.