Performance metrics expose numeric measurements of a running application. Unlike a health check’s up-or-down result, a metric can show how behavior changes over time: response time, request volume, memory use, or thread-pool occupancy. Monitoring systems can turn those values into charts, statistics, and threshold-based alerts. section 10.0 section 10.3
Choose a metric type that matches the measurement:
- A counter counts occurrences and only increases; a gauge holds a value that can rise or fall. section 10.3.2
- A timer measures operation duration; a distribution summary collects numeric values not necessarily tied to time. Both can report a maximum, count, and sum. section 10.3.2
- Framework metrics describe general runtime behavior and are usually supplied automatically. Business metrics measure domain events, such as orders placed. section 10.3
In Quarkus, use the Micrometer extension for metrics. Its common API supports multiple monitoring backends. For Prometheus output, add `micrometer-registry-prometheus` with `quarkus extension add micrometer-registry-prometheus`, start the application, and inspect `/q/metrics`. Quarkus exposes built-in measurements there when Micrometer is enabled; Prometheus can periodically scrape the endpoint, and Grafana can query Prometheus to display dashboards. section 10.3.1 section 10.3.5 section 10.3.6
Add a business counter declaratively with `@Counted` on a CDI bean method: an interceptor increments it when the method is called. For more control, inject Micrometer’s `MeterRegistry` and call `meterRegistry.counter("orders").increment()`; the registry gets or creates that counter. The imperative approach is more flexible but more verbose. section 10.3.4
Count car registrations
Annotate the registration method with `@Counted(description = "Number of car registrations")`, then perform a registration. The exported counter can include the method, result, and exception as tags, making the measurement queryable by those dimensions. section 10.3.6 section 10.3.3
Tags distinguish measurements that share a name. For HTTP requests, method, path, and status tags support useful aggregation; each unique combination has its own measurement. Prefer dimensions with few distinct values: a user ID creates too many unique combinations. In the Prometheus response, `# HELP` and `# TYPE` lines describe a metric, while unprefixed lines carry values. section 10.3.3 section 10.3.6
Version compatibility matters: although MicroProfile 6.1 includes Metrics 5.1, Quarkus 3.15 supports only MicroProfile Metrics 4.0. Its compatible SmallRye Metrics extension is not recommended and is slated for removal; Micrometer is the preferred path. section 10.3.1







































