This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/tomcat-jdbc-8.5.md.

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

MetricInstrumentTypeUnitDescription
db.client.connections.idle.maxupdowncounterLONG_SUM{connections}The maximum number of idle open connections allowed.
db.client.connections.idle.minupdowncounterLONG_SUM{connections}The minimum number of idle open connections allowed.
db.client.connections.maxupdowncounterLONG_SUM{connections}The maximum number of open connections allowed.
db.client.connections.pending_requestsupdowncounterLONG_SUM{requests}The number of pending requests for an open connection, cumulative for the entire pool.
db.client.connections.usageupdowncounterLONG_SUM{connections}The number of connections that are currently in state described by the state attribute.
MetricAttributes
db.client.connections.idle.maxpool.name (STRING)
db.client.connections.idle.minpool.name (STRING)
db.client.connections.maxpool.name (STRING)
db.client.connections.pending_requestspool.name (STRING)
db.client.connections.usagepool.name (STRING), state (STRING)

When otel.semconv-stability.opt-in=database

Metrics

MetricInstrumentTypeUnitDescription
db.client.connection.countupdowncounterLONG_SUM{connection}The number of connections that are currently in state described by the state attribute.
db.client.connection.idle.maxupdowncounterLONG_SUM{connection}The maximum number of idle open connections allowed.
db.client.connection.idle.minupdowncounterLONG_SUM{connection}The minimum number of idle open connections allowed.
db.client.connection.limitupdowncounterLONG_SUM{connection}The maximum number of open connections allowed.
db.client.connection.pending_requestsupdowncounterLONG_SUM{request}The number of current pending requests for an open connection.
MetricAttributes
db.client.connection.countdb.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.maxdb.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG)
db.client.connection.idle.mindb.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG)
db.client.connection.limitdb.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG)
db.client.connection.pending_requestsdb.client.connection.pool.name (STRING), db.namespace (STRING), db.system.name (STRING), server.address (STRING), server.port (LONG)

Configuration

OptionTypeDefaultDescription
otel.semconv-stability.opt-inlistOpt-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.

Data

  • JSON (latest): /data/javaagent/instrumentations/tomcat-jdbc-8.5/latest.json
  • JSON (pinned): /data/javaagent/instrumentations/tomcat-jdbc-8.5/tomcat-jdbc-8.5-a2091ab864f6.json
  • Explore: /java-agent/instrumentation/tomcat-jdbc-8.5