Introduction
In this tutorial you will learn how to use the Prometheus API Client for Python to collect and manipulate Prometheus time-series metric data.
We will use a Jupyter notebook to interact with a Prometheus instance which is currently being deployed.
Please give the environment a couple of minutes to set up.
Once the environment is ready to be used, you will see the links to access it in your workshop terminal.
The Environment
During this tutorial you will be using a hosted OpenShift 4.2 environment that is created just for you. This environment is not shared with other users of the system.
Your environment will only be active for a one hour period. Keep this in mind before embarking on getting through the content.
Each time you start this tutorial, a new environment will be created on the fly.
Let's get started!
The contents of this scenario are available on github
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.
- Prometheus API Client Python - A Python side client to query metrics data from Prometheus.
- Jupyter Notebooks - an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text.
Time-series forecasting on Prometheus metrics
- We have a workshop that shows how Prometheus metrics can be used for data science applications:
https://learn.openshift.com/ai-machine-learning/prometheus-timeseries-forecasting/
Deploying Prometheus and Grafana on OpenShift
- We have a workshop that shows how to deploy Prometheus and Grafana on OpenShift and also create a basic Grafana dashboard:
https://learn.openshift.com/introduction/deploy-prometheus-grafana/

Steps
Working with Prometheus Metrics in Python
More about Prometheus
What is Prometheus?
Prometheus is an open-source systems monitoring and alerting toolkit originally built at SoundCloud.
What is Prometheus API Client?
Prometheus-api-client is a python client we built to collect metric data from Prometheus and change it in a more data science suitable format of a Pandas Dataframe.