Skip to content

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.

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 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
LanguageLibraries Auto-Instrumented
JavaJDBC, Hibernate, Spring Data
PythonSQLAlchemy, psycopg2, PyMySQL, Django ORM
Node.jspg, mysql2, mongoose, Prisma
.NETEntity Framework, Npgsql, MySqlConnector
Godatabase/sql, GORM, pgx

Configure your OpenTelemetry SDK to export to the KloudMate Agent OTLP endpoint:

OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
OTEL_SERVICE_NAME="your-service-name"

Database spans will automatically be captured when using supported auto-instrumentation libraries.