Skip to content

Latest commit

 

History

History
101 lines (80 loc) · 3.88 KB

14-monitoring-basics.adoc

File metadata and controls

101 lines (80 loc) · 3.88 KB

OpenShift Monitoring

In this lab you will explore various aspects of the builtin OpenShift Monitoring. This includes an overview of the OpenShift Alertmanager UI, accessing the Prometheus web console, running PromQL (Prometheuses Query Language) queries to inspect the cluster and finally looking at Grafana dashboards.

OpenShift Monitoring

OpenShift Container Platform includes a pre-configured, pre-installed, and self-updating monitoring stack that is based on the Prometheus open source project and its wider eco-system. It provides monitoring of cluster components and includes a set of alerts to immediately notify the cluster administrator about any occurring problems and a set of Grafana dashboards. The cluster monitoring stack is only supported for monitoring OpenShift Container Platform clusters.

Examine Alerting Configuration

Login to the console as the admin user.

oc whoami --show-console
  1. On the left hand side, click on the "Observe" drop down.

  2. Click on "Alerting". This is the OpenShift console’s view of the alert configuration.

The Alerting tab shows you information about currently configured and/or active alerts. You can see and do several things:

  1. Filter alerts by their names.

  2. Filter the alerts by their states. To fire, some alerts need a certain condition to be true for the duration of a timeout. If a condition of an alert is currently true, but the timeout has not been reached, such an alert is in the Pending state.

  3. Alert name.

  4. Description of an alert.

  5. Current state of the alert and when the alert went into this state.

  6. Value of the Severity label of the alert.

  7. Actions you can do with the alert.

You’ll also note that you can click directly into the Alertmanager UI with a link that’s at the top of this page.

Metrics UI (Prometheus Console)

In addition to the Alerting screen, OpenShift’s built-in monitoring provides an interface to access metrics collected by Prometheus using the Prometheus Query Language (PromQL).

  1. On the left hand side of the OpenShift Console, under the "Observe" section, click the link for "Metrics".

Running Prometheus Queries

Let’s run a query to see the resources memory limit all pod definitions have defined.

  1. Copy and paste the following query into the expression text box:

    node_netstat_Udp6_OutDatagrams
  2. Click the "Run Queries" button

  3. You should now see a timeseries with a value in the list. You will also see a graph showing the value over the last time period (defaults to 30m).

Now let’s run a query to see the cpu usage for the entire cluster.

  1. Click "Add Query"

  2. Copy and paste the following query into the query text box:

    cluster:cpu_usage_cores:sum
  3. Click the "Run Queries" button

  4. You should now see a timeseries with a value in the list. This value is the latest gathered value for the timeseries as defined by this query. You’ll also see that your new query got plotted on the same graph.

The metrics interface lets you run powerful queries on the information collected about your cluster.

You’ll also note that you can click directly into the Prometheus UI with a link that’s at the top of this page.

Dashboards UI (Grafana)

In addition to the Metrics UI, OpenShift monitoring provides a preconfigured "Dashboards" UI (aka "Grafana"). The purpose of these Dashboards is to show multiple metrics in easy to consume form graphed over time.

Click the "Dashboards" link under the "Observe" section on the left hand side.

ocp grafana replacement
Figure 1. Dashboards OpenShift

Here you can click on the "Dashboard" arrow and select different metrics to visualize. Go ahead and play around with this view. Note that this is a visualization of the information that is provided by Prometheus.