Prometheus and Grafana form a practical monitoring stack for collecting time-series metrics, exploring system behavior, and turning important changes into actionable alerts. This guide explains how to structure a reliable implementation, what to track across applications and infrastructure, how to design useful dashboards and PromQL queries, and when to review the stack so monitoring remains aligned with production needs.
Overview
Prometheus is a metrics collection and alerting system. It commonly gathers measurements by scraping HTTP endpoints exposed by applications, exporters, and infrastructure components. Grafana connects to Prometheus and other data sources to provide dashboards, visual exploration, and alert presentation. Used together, they are widely applicable observability tools for teams operating services, containers, Kubernetes clusters, and cloud infrastructure.
The stack is most effective when it answers operational questions rather than simply displaying a large number of charts. A useful monitoring implementation should help a team determine whether a service is available, whether it is meeting its performance objectives, what changed before an incident, and which component requires attention.
A typical design has four layers:
- Collection: Prometheus scrapes metrics from applications, exporters, and platform components.
- Storage: Prometheus stores time-series data locally for a configured retention period, with optional long-term storage integrations where appropriate.
- Analysis: PromQL queries calculate rates, ratios, percentiles, aggregations, and comparisons.
- Presentation and action: Grafana dashboards and alerting workflows make trends visible and route important conditions to the right responders.
Start with a small set of high-value signals. Adding every available metric can increase storage, query complexity, and alert noise without improving decisions. For broader tool selection, the DevOps Tools Directory provides a useful way to compare observability and related DevOps tools by category.
What to track
Service health and user impact
Begin with metrics that describe the experience of the user or the consumer of a service. Track request volume, error volume, latency, and availability. For latency, look beyond an average when the monitoring system supports histogram-based measurements. Percentiles or bucket distributions can reveal a slow minority of requests that an average conceals.
Useful questions include:
- How many requests are being served?
- What proportion returns an error?
- How long do requests take at the typical and slower response levels?
- Are failures concentrated by route, method, region, tenant, or dependency?
Keep labels controlled. Labels such as method, route, and status_code are often useful, while unrestricted user IDs, request IDs, or raw URLs can create excessive time-series cardinality.
Resources and platform components
For hosts, containers, and Kubernetes workloads, monitor CPU utilization, memory working set, filesystem capacity, network throughput, restarts, readiness, and resource limits. These metrics should be interpreted together. High CPU may be expected during a batch job, while a rising restart count combined with failing readiness probes is more likely to require immediate investigation.
For Kubernetes environments, also track desired versus available replicas, pending pods, container termination reasons, scheduling failures, and node pressure. When these signals point to a workload or cluster problem, the Kubernetes Troubleshooting Guide can support a more systematic diagnosis.
Dependencies and business-relevant workflows
Databases, queues, caches, external APIs, and storage systems should have their own health indicators. Track connection saturation, query or operation latency, queue depth, consumer lag, cache hit behavior, and dependency error rates where those measurements are available.
Technical metrics become more useful when connected to a critical workflow. For example, an order-processing service might track accepted orders, failed payments, processing backlog, and completion time. These metrics should complement—not replace—service-level infrastructure signals.
Prometheus collection health
Monitor the monitoring system itself. Check whether scrape targets are up, scrape durations are increasing, samples are being rejected, rules are evaluating successfully, and Prometheus is approaching its storage or resource limits. A dashboard that reports only application health can give false confidence if collection has stopped.
Cadence and checkpoints
Use different review intervals for different monitoring tasks. During implementation, inspect dashboards and alerts after each meaningful deployment or configuration change. Once the stack is stable, a recurring review helps prevent stale panels, unused alerts, and undocumented dependencies.
Per-deployment checks
- Confirm that new or changed targets are being scraped.
- Compare request rate, error rate, and latency with the previous release.
- Verify that dashboard variables still return expected services and environments.
- Test alert expressions against a known condition in a safe environment where possible.
- Check that notification routing reaches the intended team without exposing sensitive data.
Weekly operational review
Review alerts that fired, alerts that were ignored, and alerts that required manual investigation. Look for repeated pages caused by one underlying event, alerts that resolve before anyone can act, and conditions discovered by users before monitoring identified them. Record the diagnosis and link the relevant dashboard or runbook.
Monthly or quarterly maintenance
On a monthly or quarterly cadence, review the metric inventory, dashboard ownership, label cardinality, retention requirements, and recording rules. Remove panels that no longer support a decision. Consolidate duplicate alerts. Recheck thresholds after traffic patterns, capacity, architecture, or service objectives change.
Reviewing infrastructure changes alongside observability is important. For example, an application deployment may change metric names or labels, while a Kubernetes or Terraform change may alter targets and resource behavior. The Infrastructure Drift Detection Guide can help teams connect configuration changes with operational review.
How to interpret changes
Use PromQL to ask focused questions
PromQL is most valuable when a query supports a specific operational decision. A simple rate query can show the request volume over time:
sum(rate(http_requests_total[5m]))To estimate the proportion of server errors, compare an error rate with the total request rate. The exact metric and label names depend on the application instrumentation:
sum(rate(http_requests_total{status_code=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))For capacity analysis, aggregate by a meaningful dimension rather than displaying every individual series. For example, group by service or namespace when the question concerns workload-level behavior. Use recording rules for expensive or frequently reused expressions so dashboards and alerts do not repeatedly calculate the same complex query at display time.
Read trends in context
A single spike is a clue, not necessarily an incident. Compare it with deployment timestamps, traffic volume, scheduled jobs, dependency health, and resource saturation. A latency increase during a traffic surge may indicate capacity pressure; the same increase at normal traffic may point to a dependency, code path, or configuration change.
Correlate related signals:
- Rising latency plus rising database time suggests investigating the database or query path.
- Increasing queue depth plus stable producer traffic may indicate consumer degradation.
- High memory use plus repeated restarts may indicate a limit, leak, or workload change.
- Missing data across many targets may indicate a collection, network, or Prometheus issue rather than an application outage.
Design dashboards for decisions
Organize Grafana dashboards from summary to detail. The first row should show service state, request rate, error rate, and latency. Additional rows can cover dependencies, resources, logs or traces through links, and deployment markers. Use consistent units, explicit time ranges, clear legends, and environment or service variables. A dashboard should make the next investigation step obvious; it should not require the reader to interpret a wall of nearly identical panels.
Alert on symptoms and actionability
An alert should identify a meaningful condition, provide enough context to begin diagnosis, and have a clear owner. Prefer alerts tied to user impact or a credible risk, such as sustained error rates, unavailable replicas, exhausted disk capacity, or a queue that is not recovering.
Set a duration for conditions that should persist before notification. This reduces pages caused by brief fluctuations, but the duration should reflect the system’s behavior and the cost of delay. Include labels such as service, environment, severity, and team, plus annotations containing a concise summary, likely impact, dashboard link, and runbook link.
Use notification routing to separate urgent pages from lower-priority tickets or messages. Group related alerts so one failure does not produce an unmanageable stream of duplicate notifications. Review alert history regularly and treat noisy or unactionable alerts as defects in the monitoring system.
When to revisit
Revisit the Prometheus and Grafana setup after every significant architecture, traffic, deployment, or ownership change. New services may need instrumentation and dashboards; renamed labels can break queries; a change from virtual machines to containers can invalidate host assumptions; and a new dependency can introduce a failure mode that was not previously visible.
At least monthly, check that:
- All critical targets are present and successfully scraped.
- Dashboards still reflect the current service topology.
- Alert owners, routing labels, runbooks, and escalation paths are current.
- Retention and storage usage match the team’s investigation needs.
- High-cardinality metrics and expensive queries are controlled.
- Recording rules remain useful and evaluate without errors.
- Recent incidents produced monitoring improvements where gaps were found.
At least quarterly, reassess the signals against the services’ current reliability goals. Ask which alerts led to action, which incidents lacked useful data, and which dashboards people actually used during investigations. Update the stack based on those findings rather than adding metrics by default.
A practical next step
Choose one production service and create a focused monitoring slice: request volume, error rate, latency, dependency health, resource behavior, and collection status. Add one actionable alert for each significant failure mode, a Grafana dashboard with a clear investigation path, and a short runbook. Review the results after the next deployment and again during the next monthly operations review. This incremental approach builds observability that remains maintainable while giving the team a repeatable way to improve reliability.