This section describes how to use the Prometheus monitoring system to collect, store and query metrics about Che.

Prerequisites
Procedure
  • Configure Prometheus to scrape metrics from the 8087 port:

    Prometheus configuration example
    apiVersion: 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)
    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 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 Using the expression browser in the Prometheus documentation.