UCP metrics are database-client metrics from Oracle UCP (Universal Connection Pool), Oracle’s JDBC connection pool. Like HikariCP, UCP exposes pool-specific metrics: current and maximum connections, callers waiting for a connection, acquisition time, and pool lifecycle activity.
These metrics help separate a slow query from a slow path to a query. When an application exhausts its pool, waits to acquire connections, or accumulates latency before calls reach Oracle AI Database, UCP metrics show where to investigate.
Configure and use UCP metrics
To start collecting metrics, add the oracle-spring-boot-ucp-micrometer dependency to your project. spring-boot-starter-actuator should be included to manage and scrape metrics:
<dependency>
<groupId>cm.oracle.database.spring</groupId>
<artifactId>oracle-spring-boot-ucp-micrometer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>Then, configure your project to export metrics via application properties. For Spring Actuator expose the /actuator/metrics endpoint:
management:
endpoints:
web:
exposure:
include: metricsFor push-based collection, configure Spring Boot’s OTLP metrics exporter:
management:
otlp:
metrics:
export:
enabled: true
url: http://your-otel-endpoint:4318/v1/metrics
step: 5sTry it out with our UCP Spring Boot sample
If you’d like to experiment with metrics using Oracle AI Database Free, I built an all-in-one Docker Compose sample that spins up Oracle AI Database, a Spring Boot app, and Grafana LGTM for testing.
To test the sample, check out the code here and run:
export ORACLE_PWD="${ORACLE_PWD:-Welcome12345}"
docker compose up --build -dThen, check out the Grafana dashboard at http://localhost:3000.
A sample load-generator script is provided to utilize the connection pool.

Sample Grafana Dashboard
To help you visualize statistics from UCP, I built a sample Grafana dashboard that uses these metrics. You can adopt this dashboard out of the box, or use it as a starting point for customization.
The dashboard includes information about the selected connection pool, like active connections, utilization rate, latency:

What kind of UCP metrics are collected?
OpenTelemetry database client metrics are exposed under the db.client namespace with the db.client.connection.pool.name attribute set to the configured spring.datasource.oracleucp.connection-pool-name. Otherwise, he Spring DataSource bean name is used as the pool name.
| Metric | Description | Key attributes |
|---|---|---|
db.client.connection.count | Connections currently available (idle) or borrowed (used) | db.client.connection.pool.name, db.client.connection.state |
db.client.connection.max | Configured upper limit for open connections | db.client.connection.pool.name |
db.client.connection.idle.min | Configured minimum idle connections, when the UCP version supports it | db.client.connection.pool.name |
db.client.connection.pending_requests | Requests currently waiting for a connection | db.client.connection.pool.name |
The module also includes UCP-specific metrics under the ucp.connections namespace, which describe the connection pool in detail:
| Group | Examples | What it’s for |
|---|---|---|
| Capacity and inventory | ucp.connections, .min, .capacity, .peak | Total, minimum, remaining, and peak connections |
| Utilization | .active.average, .active.peak, .labeled, .abandoned | Borrowed connection levels, labels, and reclaimed abandoned connections |
| Lifecycle | .created, .closed, .borrowed, .returned, .creation.attempts | Pool creation, closure, and borrow/return activity |
| Acquisition | .acquire.average, .acquire.peak, .acquire, .acquire.failed, .acquire.total | Typical, worst-case, successful, failed, and combined acquisition time |
| Usage | .usage | Time connections spend in use |
References
- Check out the UCP metrics documentation for metric reference and setup details.
- See How to tune Oracle UCP for details on tuning UCP in Spring Boot applications.
- For more practical work on Oracle AI Database telemetry, browse my other observability posts.

Leave a Reply