...
- is our application working?
- how many requests per second is it responding to?
- what are the response times?
- how much network traffic is it producing?
- how stressed are the servers on which our application is located?
- what is the http request that always responds in a very long time?
- the database is unable to respond quickly enough, but maybe there is a bottleneck somewhere?
The Prometheus opensource monitoring solution (official page) can solution can answer these and many other questions and addresses and solves these problems thanks also to the excellent travel companion Grafana. Grafana is a web application that creates graphs divided into panels, with data coming from a variety of different sources, such as OpenTSDB, InfluxDB, ElasticSearc and Prometheus itself.
...
Probably the fastest and most efficient way to get Prometheus is via Helm chart. Add the repo (reference) and Add the repo and install the chart (here we work in namespace monitoring
)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# Add the prometheus-community repo and perform a general update of the repositories $ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts $ helm repo update # Install Chart $ kubectl create namespace monitoring Use the --create-namespace flag, if the namespace does not exist $ helm install <chart_name> prometheus-community/kube-prometheus-stack -n monitoring [--create-namespace] |
In this way we will have already deployed all the components in our cluster. To perform a quick test, you can connect, via browser, to the user interfaces of Prometheus and Grafana, modifying the two services
in a similar way to what was seen for the Kubernetes dashboard: edit
the type of service
, from ClusterIP
to NodePort
, and select a port in the range 30000-32767. At the first access to Grafana you will be asked for your credentials, which you can later change. Credentials are present in github site.
...