blob: 14a30f2d5cbb7664dddc6e2b2299322a24373e60 [file] [log] [blame]
// monitoring-{prod-id-short}
[id="collecting-{prod-id-short}-metrics-with-prometheus_{context}"]
= Collecting {prod-short} metrics with Prometheus
This section describes how to use the Prometheus monitoring system to collect, store and query metrics about {prod-short}.
.Prerequisites
* {prod-short} is exposing metrics on port `8087`. See xref:enabling-and-exposing-{prod-id-short}-metrics_{context}[Enabling and exposing {prod-id-short} metrics].
* Prometheus 2.9.1 or higher is running. The Prometheus console is running on port `9090` with a corresponding *service* and *route*. See link:https://prometheus.io/docs/introduction/first_steps/[First steps with Prometheus].
.Procedure
* Configure Prometheus to scrape metrics from the `8087` port:
+
.Prometheus configuration example
[source,yaml,subs="+attributes"]
----
include::examples/prometheus-config.adoc[]
----
ifeval::["{project-context}" == "che"]
+
Latest version: link:https://+github.com/eclipse/che/blob/master/deploy/openshift/templates/monitoring/prometheus-config.yaml[example `prometheus-config.yaml` on GitHub].
endif::[]
+
<1> Rate, at which a target is scraped.
<2> Rate, at which recording and alerting rules are re-checked (not used in the system at the moment).
<3> Resources Prometheus monitors. In the default configuration, there is a single job called `che-host`, which scrapes the time series data exposed by the {prod-short} server.
<4> Scrape metrics from the `8087` port.
.Verification steps
* Use the Prometheus console to query and view metrics.
+
Metrics are available at: `http://_<che-server-url>_:9090/metrics`.
+
For more information, see link:https://prometheus.io/docs/introduction/first_steps/#using-the-expression-browser[Using the expression browser] in the Prometheus documentation.
.Additional resources
* link:https://prometheus.io/docs/introduction/first_steps/[First steps with Prometheus].
* link:https://prometheus.io/docs/prometheus/latest/configuration/configuration/[Configuring Prometheus].
* link:https://prometheus.io/docs/prometheus/latest/querying/basics/[Querying Prometheus].
* link:https://prometheus.io/docs/concepts/metric_types/[Prometheus metric types].