This section describes how to use the Prometheus monitoring system to collect, store and query metrics about Che.
Prerequisites
-
Che is exposing metrics on port
8087. See Enabling and exposing che metrics. -
Prometheus 2.9.1 or higher is running. The Prometheus console is running on port
9090with a corresponding service and route. See First steps with Prometheus.
Procedure
-
Configure Prometheus to scrape metrics from the
8087port:Prometheus configuration exampleapiVersion: v1 kind: ConfigMap metadata: name: prometheus-config data: prometheus.yml: |- global: scrape_interval: 5s (1) evaluation_interval: 5s (2) scrape_configs: (3) - job_name: 'che' static_configs: - targets: ['[che-host]:8087'] (4)Latest version: example
prometheus-config.yamlon GitHub.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 Che server.4 Scrape metrics from the 8087port.
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 Using the expression browser in the Prometheus documentation.
Additional resources