Monitoring with Prometheus & Grafana — A Practical Setup Guide
You cannot fix what you cannot see. Learn how Prometheus collects metrics, how Grafana visualises them, and how to build alerting that catches problems before your users do.
Rajesh Vardhan Busam
SRE & Observability Instructor

When a production system misbehaves at two in the morning, the difference between a five-minute fix and a five-hour outage is monitoring. You cannot fix what you cannot see. Prometheus and Grafana are the open-source pair that most companies rely on to understand what their systems are doing, and together they form a skill set that is central to both DevOps and the well-paid Site Reliability Engineering role. This guide explains how they fit together and how to build a monitoring stack that actually helps.
The Three Pillars of Observability
Observability rests on three types of data. Metrics are numbers measured over time — CPU usage, request rate, error count. Logs are timestamped records of individual events. Traces follow a single request as it travels across multiple services. Prometheus and Grafana focus primarily on metrics, which is the best place for beginners to start because metrics are compact, cheap to store, and answer most operational questions.
How Prometheus Works
Prometheus is a time-series database that pulls metrics from your applications and infrastructure. Each target exposes a simple HTTP endpoint that lists its current metrics, and Prometheus scrapes that endpoint at a regular interval, storing every value with a timestamp and a set of labels. Those labels — such as the instance, the environment, or the endpoint — let you slice and filter data precisely.
The pull model is one reason Prometheus is so reliable: it does not depend on applications successfully pushing data out, and Prometheus itself can detect when a target stops responding. This makes it excellent at telling you not only how a service is doing but whether it is alive at all.
Querying with PromQL
You query the collected data with PromQL, a purpose-built query language. With it you can calculate a request rate over the last five minutes, compute the ninety-fifth percentile latency, or measure the ratio of errors to total requests. PromQL feels unusual at first because it works on time-series and ranges rather than rows, but it becomes powerful quickly, and a handful of query patterns cover most day-to-day needs.
Exporters — Getting Metrics Out of Everything
Your own application can expose metrics directly using a client library for your language. For everything else, there are exporters — small programs that translate a system's internal statistics into the format Prometheus understands. The node exporter exposes server metrics like CPU, memory, and disk. There are exporters for databases, message queues, and web servers, and cAdvisor exposes container metrics. With the right exporters, you can monitor almost anything without modifying it.
Where Grafana Comes In
Prometheus stores and queries data, but raw numbers are hard to interpret at a glance. Grafana connects to Prometheus as a data source and turns your queries into clear, live dashboards — line graphs, gauges, heatmaps, and single-stat panels. A well-built dashboard lets you understand the health of a whole system in seconds. You can start with community dashboards that others have already built for common exporters, then customise them for your own services. Organise panels by concern: one row for traffic, one for errors, one for latency, one for resource usage.
Alerting — The Part That Actually Saves You
Dashboards are useless if nobody is watching them at two in the morning, which is exactly when things break. That is what alerting is for. You define alert rules — for example, fire an alert if the error rate exceeds one percent for five minutes, or if disk usage crosses ninety percent. When a rule fires, an alertmanager routes the notification to the right channel: Slack, email, or an on-call paging tool, with the ability to group, silence, and escalate alerts sensibly.
Good alerts are actionable and rare. If an alert fires constantly, people start ignoring it — this is alert fatigue, and it is dangerous because it hides real problems. Alert on symptoms your users actually feel, not on every internal fluctuation.
The Golden Signals — Where to Start
If you do not know what to monitor first, begin with the four golden signals. Latency is how long requests take. Traffic is how many requests you receive. Errors is how many requests fail. Saturation is how full your resources are. These four cover the majority of what goes wrong in practice, and they translate directly into a small, focused dashboard and a handful of high-value alerts.
A Realistic Setup
A practical monitoring stack looks like this: your applications and infrastructure expose metrics, Prometheus scrapes and stores them, Grafana visualises them in dashboards organised by service, and the alertmanager routes a small number of meaningful alerts to your team's chat and on-call tool. In Kubernetes, this whole stack is commonly installed with a single Helm chart, giving you Prometheus, Grafana, and pre-built dashboards in minutes. Start small, monitor the golden signals, and expand as you learn.
Common Mistakes
- Building beautiful dashboards but no alerts, so nobody knows when things break.
- Alerting on everything, causing fatigue that hides real incidents.
- Monitoring internal metrics like CPU while ignoring what users experience.
- Never testing alerts, then discovering during an outage that they never fire.
Frequently Asked Questions
Do I need to know PromQL deeply? Learn the common patterns — rates, percentiles, and ratios. They cover most real dashboards and alerts.
Is this useful outside Kubernetes? Yes. Prometheus and Grafana monitor plain servers, databases, and any application that exposes metrics, not just Kubernetes.
How does this relate to SRE? Directly — Site Reliability Engineering is built on measuring reliability, and these tools are how you measure it.
Monitoring is a core skill for both DevOps and SRE roles, which are among the highest-paid in the field. Our observability labs at Infinity Cloud Labs walk you through building this full stack on real infrastructure — in both English and Telugu.
Tags
