Tomcat JDBC
OpenTelemetry Java agent instrumentation
This instrumentation enables database connection pool metrics for Tomcat JDBC. When no pool name is explicitly configured, the JDBC URL and connection properties are used to derive the pool name. With legacy database semantic conventions, the derived format is server.address[:server.port][/db.namespace]. With stable database semantic conventions, the first available value among db.namespace, the configured endpoint (server.address[:server.port]), and db.system.name is used. If none is available, tomcat-jdbc is used.
- Name:
tomcat-jdbc-8.5 - Scope:
io.opentelemetry.tomcat-jdbc - Target versions:
org.apache.tomcat:tomcat-jdbc:[8.5.0,) - Library: https://tomcat.apache.org/tomcat-8.5-doc/jdbc-pool.html
Telemetry
When default
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
db.client.connections.idle.max | updowncounter | LONG_SUM | {connections} | The maximum number of idle open connections allowed. |
db.client.connections.idle.min | updowncounter | LONG_SUM | {connections} | The minimum number of idle open connections allowed. |
db.client.connections.max | updowncounter | LONG_SUM | {connections} | The maximum number of open connections allowed. |
db.client.connections.pending_requests | updowncounter | LONG_SUM | {requests} | The number of pending requests for an open connection, cumulative for the entire pool. |
db.client.connections.usage | updowncounter | LONG_SUM | {connections} | The number of connections that are currently in state described by the state attribute. |
| Metric | Attributes |
|---|---|
db.client.connections.idle.max | pool.name (STRING) |
db.client.connections.idle.min | pool.name (STRING) |
db.client.connections.max | pool.name (STRING) |
db.client.connections.pending_requests | pool.name (STRING) |
db.client.connections.usage | pool.name (STRING), state (STRING) |
When otel.semconv-stability.opt-in=database
Metrics
| Metric | Instrument | Type | Unit | Description |
|---|---|---|---|---|
db.client.connection.count | updowncounter | LONG_SUM | {connection} | The number of connections that are currently in state described by the state attribute. |
db.client.connection.idle.max | updowncounter | LONG_SUM | {connection} | The maximum number of idle open connections allowed. |
db.client.connection.idle.min | updowncounter | LONG_SUM | {connection} | The minimum number of idle open connections allowed. |
db.client.connection.limit | updowncounter | LONG_SUM | {connection} | The maximum number of open connections allowed. |
db.client.connection.pending_requests | updowncounter | LONG_SUM | {request} | The number of current pending requests for an open connection. |
| Metric | Attributes |
|---|---|
db.client.connection.count | db.client.connection.pool.name (STRING), db.client.connection.state (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG) |
db.client.connection.idle.max | db.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG) |
db.client.connection.idle.min | db.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG) |
db.client.connection.limit | db.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG) |
db.client.connection.pending_requests | db.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG) |
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
otel.semconv-stability.opt-in | list | Opt-in to emit stable semantic conventions instead of the old experimental semantic conventions. Accepts a comma-separated list of semantic convention groups (e.g., database, http, messaging). Use <group>/dup to emit both old and new conventions simultaneously. Stable semantic conventions will become the default in version 3.0 of the agent. |