What is Prometheus? As per the official documentation, Prometheus is an open source system monitoring tool kit based on a time series database. It measures values at a periodic occurrence of time. It was founded at Sound Cloud in the year 2012, but is a standalone open source project and maintained independently of any single company. It was adopted by CNCF in 2016.
What is Prometheus?
Prometheus is a pull-based monitoring system. Take a look at the above reference architecture. It can be designed to monitor servers, virtual machines, databases, etc. We know it is crucial to monitor these resources periodically. It relies on HTTP calls. For example: If a web server is hosted at http://foo-bar:8080, and exposes metrics at http://foo-bar:8080/metrics, Prometheus pulls the data from the target URL. The most important point to note here is that Prometheus is not an event-based monitoring system, meaning it does not send alerts. Instead, it collects pre-determined metrics about your applications based on rules.
From the diagram, we see that Prometheus collects metrics from pre-configured services or applications and then stores it on a storage disk. The collected data is pushed to its alert management system. From there, it is retrieved for pager use, email, or any other methods.
Data visualization: As seen in the above diagram, you can visualize a target's data using the Prometheus web-ui. It also has a filtering system that allows the user to view custom metrics.
Getting my hands dirty with Prometheus
So, there are two options for getting started with Prometheus:
- Make use of this scenario using Katakoda.
- Follow along by installing minikube on a CentOS 8 machine.
Since it's a hands-on blogpost, I focus on the second method and leave the first method to curious readers.
After the minikube is up and running:
Next, enable helm by following the steps below. If you want to brush up on helm basics, please refer to the official help.
$ curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
$ chmod 700 get_helm.sh
$ ./get_helm.sh
After you enable helm, you just need to install Prometheus using this command:
[root@prometheus-server ~]# helm install prometheus stable/prometheus --namespace monitoring
Error: failed to download "stable/prometheus" (hint: running `helm repo update` may help)
[root@prometheus-server ~]# helm repo add stable https://kubernetes-charts.storage.googleapis.com/
"stable" has been added to your repositories
[root@prometheus-server ~]# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "stable" chart repository
Update Complete. ⎈ Happy Helming!⎈
[root@prometheus-server ~]# helm install prometheus stable/prometheus --namespace default
Now we see that Prometheus is installed on minikube. We list its service information with the following command:
[root@prometheus-server ~]# minikube service list
|-------------|-------------------------------|--------------|-----|
| NAMESPACE | NAME | TARGET PORT | URL |
|-------------|-------------------------------|--------------|-----|
| default | kubernetes | No node port |
| default | prometheus-alertmanager | No node port |
| default | prometheus-kube-state-metrics | No node port |
| default | prometheus-node-exporter | No node port |
| default | prometheus-pushgateway | No node port |
| default | prometheus-server | No node port |
| kube-system | kube-dns | No node port |
| kube-system | metrics-server | No node port |
What's next?
This article covers the basic concepts of Prometheus as well as installation on minikube. I will cover applications monitoring in the next article, so be sure to keep an eye out for that.
More resources:
- The Official Prometheus Website
- Prometheus Monitoring: The Definitive Guide
- How to Set Up Prometheus and Ingress on Kubernetes
[ Free cheat sheet: Kubernetes glossary ]
Sobre o autor
I work as a Solutions Engineer at Red Hat and my day-to-day work involves OpenShift and Ansible. I'm highly passionate about open source software, cloud, security, and networking technologies.
Mais como este
Slash VM provisioning time on Red Hat Openshift Virtualization using Red Hat Ansible Automation Platform
Red Hat Ansible Automation Platform: Measuring Business Impact with Dashboard and Analytics
Technically Speaking | Taming AI agents with observability
You Can't Automate Buy-In | Code Comments
Navegue por canal
Automação
Últimas novidades em automação de TI para empresas de tecnologia, equipes e ambientes
Inteligência artificial
Descubra as atualizações nas plataformas que proporcionam aos clientes executar suas cargas de trabalho de IA em qualquer ambiente
Nuvem híbrida aberta
Veja como construímos um futuro mais flexível com a nuvem híbrida
Segurança
Veja as últimas novidades sobre como reduzimos riscos em ambientes e tecnologias
Edge computing
Saiba quais são as atualizações nas plataformas que simplificam as operações na borda
Infraestrutura
Saiba o que há de mais recente na plataforma Linux empresarial líder mundial
Aplicações
Conheça nossas soluções desenvolvidas para ajudar você a superar os desafios mais complexos de aplicações
Virtualização
O futuro da virtualização empresarial para suas cargas de trabalho on-premise ou na nuvem