Introduction to Prometheus
In Chapter 12, Collecting Service Telemetry Data, we mentioned a popular open source alerting and monitoring tool called Prometheus, which can collect service metrics and set up automated alerts based on the metric data. In this section, we will demonstrate how to use Prometheus to set up alerts for our microservices.
Let’s summarize our learnings about Prometheus from Chapter 12, Collecting Service Telemetry Data:
- Prometheus allows us to collect and store service metrics in the form of a time series
- There are three types of metrics – counters, histograms, and gauges
- To query metrics data, Prometheus offers a query language called PromQL
- Service alerts can be configured using a tool called Alertmanager
Metrics can be imported from service instances into Prometheus in two different ways:
- Scraping: Prometheus reads metrics from service instances
- Pushing: The service instance sends metrics...