> For the complete documentation index, see [llms.txt](https://ibm-developer.gitbook.io/openshift101/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ibm-developer.gitbook.io/openshift101/workshop/exercise-03.md).

# Exercise 3: Metrics and dashboards

In this exercise, we'll explore the third-party monitoring and metrics dashboards that are installed for free with OpenShift!

## Grafana

Red Hat OpenShift on IBM Cloud comes with [Grafana](https://grafana.com/) preinstalled. Get started by switching to the Administrator view:

![Administrator](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25Xbp2xB21OJoqoLQB%2Fswitch-to-admin.png?generation=1585086657841148\&alt=media)

Then Navigate to `Monitoring > Dashboards` in the left-hand bar. Then click on `Grafana UI` next to the title. You'll be asked to login with OpenShift and then click through some permissions.

![Monitoring Dashboards](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25Xnr7ukj6tuMKqcv0%2Fdashboard-menu.png?generation=1585086658881318\&alt=media)

This will open up another proxy page, click `Log in with OpenShift`.

Next, it will ask you for `Authorize Access`, take the default which is both checkboxes, and click `Allow selected permissions`.

You should then see your Grafana dashboard. Hit `Home` on the top left, and choose `Kubernetes / Compute Resources / Namespace (Pods)`.

![Grafana](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25Xnr9X3bkSSjrxe_y%2Fgrafana-namespace.png?generation=1585086657262042\&alt=media)

Under `namespace`, choose the name of the project you created in [Step 1](/openshift101/workshop/exercise-02.md#deploy-example-health) - the same one that your application is running inside.

You should be able to see the CPU and Memory usage for your application. In production environments, this is helpful for identifying the average amount of CPU or Memory your application uses, especially as it can fluctuate through the day. We'll use this information in the next exercise to set up auto-scaling for our pods.

![Grafana also project](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25Xbp6AvX6LGkJnwjf%2Fgrafana-example-health.png?generation=1585086656281778\&alt=media)

## Prometheus and Alert Manager

Navigating back to the cluster console, you can also launch Alerting and Metrics UIs

* [**Prometheus**](https://prometheus.io/) - a monitoring system with an efficient time series database
* [**Alertmanager**](https://prometheus.io/docs/alerting/alertmanager/) - an extension of Prometheus focused on managing alerts

![Metrics, Alerts and Dashboards](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25Xbp8n-qE03vjRfv-%2Fmonitoring-dashboard4.png?generation=1585086663940275\&alt=media)

## Prometheus

![Prometheus](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25XbpA8xb-NpSkOhDp%2Fprometheus-time-series4.png?generation=1585086658428420\&alt=media)

## Alertmanager

![Alert Manager](https://1137660015-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lo1CthFUNGt5R3JtwjG%2F-M3DWhsaSGpSlzs_fVm1%2F-M25XbpCCTnUxsHpi1W4%2Falert-manager4.png?generation=1585086664411436\&alt=media)
