KCNA ยท Observability
Prometheus and Grafana
Pull-based scraping, time series, labels, PromQL at a conceptual level, Alertmanager, Grafana dashboards.
Key points
- Prometheus is a CNCF graduated monitoring system that pulls (scrapes) metrics over HTTP and stores them as time series identified by a metric name plus labels.
- You query with PromQL and define alert rules; fired alerts go to Alertmanager, which groups and routes notifications.
- Grafana is a separate tool that visualizes data, for example from Prometheus, as dashboards.
Source: https://prometheus.io/docs/introduction/overview/
Practice questions
How does Prometheus normally collect metrics from a target?
- Targets push every sample to the Prometheus server
- Prometheus scrapes an HTTP endpoint on each target
- Prometheus reads the targets' log files over SSH
- The kubelet forwards all metrics to it automatically
Show answer
Answer: B. Prometheus scrapes an HTTP endpoint on each target
Prometheus pulls by scraping an HTTP endpoint on a schedule. Push is only used for special cases such as short-lived jobs via the Pushgateway.
Which statements about Prometheus are correct?
- Series are identified by a metric name and labels
- Queries are written in PromQL
- It is primarily a distributed tracing backend
- Targets must run a Prometheus agent that pushes data
- Alert notifications are routed by a separate component
Show answer
Answer: A. Series are identified by a metric name and labels, B. Queries are written in PromQL, E. Alert notifications are routed by a separate component
Prometheus stores time series with labels and uses PromQL. It does not store traces, and it does not push to targets; Grafana, not Prometheus, is the dashboard tool in this pair.
True or false: Grafana is the component that stores the time series data collected by Prometheus.
Show answer
Answer: False
False. Prometheus stores its own time series; Grafana queries data sources such as Prometheus and visualizes the results.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
