Bitzu

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

Single choice

How does Prometheus normally collect metrics from a target?

  1. Targets push every sample to the Prometheus server
  2. Prometheus scrapes an HTTP endpoint on each target
  3. Prometheus reads the targets' log files over SSH
  4. 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.

Select all that apply

Which statements about Prometheus are correct?

  1. Series are identified by a metric name and labels
  2. Queries are written in PromQL
  3. It is primarily a distributed tracing backend
  4. Targets must run a Prometheus agent that pushes data
  5. 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

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.

Download on the App StoreGet it on Google Play

More KCNA topics in this module