# Apache DBCP

<!-- llms-txt-link: /llms.txt -->

> OpenTelemetry Java agent instrumentation

This instrumentation enables database connection pools metrics for Apache DBCP.
The instrumentation uses `MBeanRegistration` methods for lifecycle detection, therefore it only activates if the `BasicDataSource` is registered to an `MBeanServer`. If using Spring Boot, this happens automatically as all Spring beans that support JMX registration are automatically registered by default.

- **Name**: `apache-dbcp-2.0`
- **Scope**: `io.opentelemetry.apache-dbcp-2.0`
- **Target versions**: `org.apache.commons:commons-dbcp2:[2,)`
- **Library**: https://commons.apache.org/proper/commons-dbcp/

## Telemetry

- **Metrics**: `db.client.connections.idle.max`, `db.client.connections.idle.min`, `db.client.connections.max`, `db.client.connections.usage`, `db.client.connection.count`, `db.client.connection.idle.max`, `db.client.connection.idle.min`, `db.client.connection.max`

## 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. |

## Data

- **JSON**: [/data/javaagent/instrumentations/apache-dbcp-2.0/apache-dbcp-2.0-2202802cb837.json](/data/javaagent/instrumentations/apache-dbcp-2.0/apache-dbcp-2.0-2202802cb837.json)
- **Explore**: [/java-agent/instrumentation/apache-dbcp-2.0](/java-agent/instrumentation/apache-dbcp-2.0)
