I have to build a monitoring solution using Prometheus and Graphana for a service which is built using React(front end)+ Node js + Db2(containerised) . I have no idea where to start,can someone suggest me the resources where to learn?Thank you.
Asked
Active
Viewed 224 times
0
-
1did you try to go through the installation manual for Prometheus and Grafana? – Krishna Chaurasia Jan 21 '21 at 07:50
-
Yes,from my understaning we need to install clients on containers which will provide metrics for prometheus server,but I don't want to change anything from application code (because that is written by someone else) – vinith alampally Jan 21 '21 at 07:54
1 Answers
1
First of all, you need to install Prometheus and Grafana in your Kubernetes cluster following the instructions given for each:
Prometheus: https://prometheus.io/docs/prometheus/latest/installation/
Grafana: https://grafana.com/docs/grafana/latest/installation/
Next, you need to understand that Prometheus is a pull-based metrics collection system. It retrieves metrics from configured targets (endpoints) at given intervals and displays the results.
You can setup the working monitoring system by implementing the below steps:
- Instrument your application code for Prometheus to be able to scrape metric from - For this, you need to add instrumentation to the code via one of the supported Prometheus client libraries.
- Configure Prometheus to scrape the metrics exposed by the service - Prometheus supports a K8s custom resource named
ServiceMonitor
introduced by the Prometheus Operator that can be used to configure Prometheus to scrape the metric defined in step 1. - Observe the scraped metrics - Next, you can observe the defined metric in either the Prometheus UI or Grafana UI by configuring Grafana support for Prometheus.

Krishna Chaurasia
- 8,924
- 6
- 22
- 35