[id='collect_metrics']
= Collecting {brandname} Metrics
Collect {brandname} metrics with monitoring tools such as Prometheus.

.Prerequisites

* Enable statistics. If you do not enable statistics, {brandname} provides `0`
and `-1` values for metrics.
* Optionally enable histograms. By default {brandname} generates gauges but not histograms.

.Procedure

* Get metrics in Prometheus (OpenMetrics) format:
+
----
$ curl -v http://localhost:11222/metrics
----

* Get metrics in MicroProfile JSON format:
+
----
$ curl --header "Accept: application/json" http://localhost:11222/metrics
----

.Next steps

Configure monitoring applications to collect {brandname} metrics. For example,
add the following to `prometheus.yml`:

----
static_configs:
    - targets: ['localhost:11222']
----

.Reference

* https://prometheus.io/docs/prometheus/latest/configuration/configuration/[Prometheus Configuration]
* link:#enable_statistics[Enabling {brandname} Statistics]
