Difficulty: beginner
Estimated Time: 10-15 minutes

Goal

Learn how to use Prometheus on OpenShift to collect metrics from an application and then visualize the results with Grafana.

Concepts

  • Prometheus, exporters, and application metrics
  • Grafana charts and graphs
  • OpenShift Web Console
  • oc OpenShift command line tool

Use case

You can analyze application metrics to spot problems, monitor performance, audit resource use, and improve your understanding of your application's behavior in order to improve it.

This OpenShift cluster will self-destruct in one hour.

Feedback for this scenario

Did you like this scenario? or Do you think we can improve on something?
You can help us by providing your feedback/suggestions here.

Continue Learning

More information about the applications we used

  • Prometheus - A Cloud native application monitoring system.
  • Grafana - A data visualization tool with alerting.

How to work with Prometheus Data in Python

Time-series forecasting on Prometheus metrics

Workshops to learn more about Openshift

Deploying Prometheus and Grafana on OpenShift

Step 1 of 4

Step 1 - Example of Prometheus metrics being exposed by an application

Playing with the demo application

The demo application is a simulated E-commerce food store application that also exposes some of it's metrics (the food store application might take up to an additional minute to be initialized).

Generating some metrics

The url for the food store is: http://metrics-demo-app-metrics-demo.[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com/

Demo Application Home Page

  • Once you are able to access the food store application, play around with it, try to buy the products you like [Everything here is free ;) ].
  • When you play around with the food store, you make the server serve some requests (GET/POST/..),
    some of the metrics for these requests are generated and exposed for Prometheus to collect.

Exposed metrics

The exposed metrics can be found here: http://metrics-demo-app-metrics-demo.[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com/metrics

  • This is the endpoint where Prometheus will scrape (collect) metrics from periodically and store them on a persistent storage device like a hard drive (Using OpenShift PersistentVolumes).

Demo Application Metrics Page

  • If you don't see similar metrics (pictured above) in your environment, try to make an order with the ecommerce application to generate a few metrics.
prometheus-configmap.yaml