OpenShift Container Platform 4.2 provides a web interface to Prometheus, which enables you to run Prometheus Query Language (PromQL) queries and examine the metrics visualized on a plot. This functionality provides an extensive overview of the cluster state and enables you to troubleshoot problems.

Contents of the Metrics UI

This section shows and explains the contents of the Metrics UI, a web interface to Prometheus.

The Metrics page is accessible by clicking MonitoringMetrics in the OpenShift Container Platform web console.

monitoring metrics screen
  1. Actions.

    • Add query.

    • Expand or collapse all query tables.

    • Delete all queries.

  2. Hide the plot.

  3. The interactive plot.

  4. The catalog of available metrics.

  5. Add query.

  6. Run queries.

  7. Query forms.

  8. Expand or collapse the form.

  9. The query.

  10. Clear query.

  11. Enable or disable query.

  12. Actions for a specific query.

    • Enable or disable query.

    • Show or hide all series of the query from the plot.

    • Delete query.

  13. The metrics table for a query.

  14. Color assigned to the graph of the metric. Clicking the square shows or hides the metric’s graph.

Additionally, there is a link to the old Prometheus interface next to the title of the page.

Running metrics queries

You begin working with metrics by entering one or several Prometheus Query Language (PromQL) queries.

Procedure
  1. Open the OpenShift Container Platform web console and navigate to the MonitoringMetrics page.

  2. In the query field, enter your PromQL query.

    • To show all available metrics and PromQL functions, click Insert Metric at Cursor.

  3. For multiple queries, click Add Query.

  4. For deleting queries, click kebab for the query, then select Delete query.

  5. For keeping but not running a query, click the Disable query button.

  6. Once you finish creating queries, click the Run Queries button. The metrics from the queries are visualized on the plot. If a query is invalid, the UI shows an error message.

    Queries that operate on large amounts of data might timeout or overload the browser when drawing timeseries graphs. To avoid this, hide the graph and calibrate your query using only the metrics table. Then, after finding a feasible query, enable the plot to draw the graphs.

  7. Optional: The page URL now contains the queries you ran. To use this set of queries again in the future, save this URL.

Additional resources

See the Prometheus Query Language documentation.

Exploring the visualized metrics

After running the queries, the metrics are displayed on the interactive plot. The X axis of the plot represents time. The Y axis represents the metrics values. Each metric is shown as a colored graph. You can manipulate the plot and explore the metrics.

Procedure
  1. Initially, all metrics from all enabled queries are shown on the plot. You can select which metrics are shown.

    • To hide all metrics from a query, click kebab for the query and click Hide all series.

    • To hide a specific metric, go to the query table and click the colored square near the metric name.

  2. To zoom into the plot and change the shown time range, do one of the following:

    • Visually select the time range by clicking and dragging on the plot horizontally.

    • Use the menu in the left upper corner to select the time range.

    To reset the time range, click Reset Zoom.

  3. To display outputs of all queries at a specific point in time, hold the mouse cursor on the plot at that point. The query outputs will appear in a pop-up box.

  4. For more detailed information about metrics of a specific query, expand the table of that query using the drop-down button. Every metric is shown with its current value.

  5. To hide the plot, click Hide Graph.