Skip to main content
This lesson assumes metrics are collected by Prometheus and alerts are handled by Alertmanager. Here we focus on the visualization layer: Grafana. Dashboards are how you triage incidents, spot trends, and communicate platform health.
The image is a blue gradient slide that reads "Visualization and Dashboards" and "Turning Data Into Insight," with a copyright note for KodeKloud.
Grafana converts time series into context-rich visuals so teams answer operational questions quickly. In this lesson you will learn how to connect Grafana to Prometheus, pick appropriate panel types, and structure dashboards optimized for quick triage.
The image outlines learning objectives related to Grafana and Prometheus, highlighting understanding Grafana's role and configuring a Prometheus data source in Grafana.
Why this matters Imagine a flash sale where latency spikes. An engineer manually queries Prometheus in the UI — each PromQL run takes time and context is missing. A colleague opens a pre-built Grafana dashboard and finds the root cause in under two minutes: a downstream payment service exhausted its connection pool. After that incident, Grafana dashboards became the mandatory first stop. Mean time to identify dropped from twenty minutes to under three. What raw metrics look like:
Raw metrics are essential but hard to interpret quickly. Grafana transforms those series into panels and dashboards that answer common questions like:
  • Is the platform healthy?
  • Which services have increasing error rates?
  • Are we approaching resource limits?
How Grafana works Grafana is organized into three layers:
The image describes the components for using Prometheus in Kubernetes, illustrating the relationships between datasources, dashboards, and panels. It specifies datasources like Prometheus and CloudWatch, dashboards focusing on specific services, and panels for visualizations like graphs and charts.
Connecting Grafana to Prometheus Step-by-step: configure the Prometheus data source in Grafana and verify connectivity.
  1. Grafana → Settings → Data sources → Add data source.
  2. Select “Prometheus”.
  3. Set the URL to the in-cluster Prometheus service, for example http://prometheus:9090. Do not use localhost unless Grafana runs on the same host as Prometheus.
  4. Toggle isDefault (or “Default”) if you want new panels to use this data source automatically.
  5. Click Save & Test.
If you need to confirm service names in Kubernetes:
The image outlines steps for connecting Grafana to Prometheus, including navigating to datasources, selecting Prometheus, setting the URL, and marking it as default.
Make sure the Prometheus URL is reachable from the Grafana pod. If Grafana cannot reach the service, check Kubernetes network policies, the service name, and the service port (Prometheus default is 9090).
Example provisioning YAML (for automated provisioning in Grafana):
Common pitfalls Choosing the right panel for the question Match visualization to intent: Common PromQL examples
Organizing dashboards for rapid triage Design dashboards top-down so the most important signals are at the top and the details are at the bottom. A practical layout:
  1. Status overview (first row)
    • Stat panels answering “is everything broken?” — use clear color thresholds.
  2. Traffic & errors (second row)
    • Time series for request rate, error rate, latency; correlate with deployments.
  3. Resources (third row)
    • Gauges and time series for CPU, memory, disk with thresholds.
  4. Details (bottom row)
    • Tables and links to logs or service-specific dashboards for drill-down.
This flow mirrors triage: glance → confirm → drill in.
The image is a guide on building effective dashboards, outlining four rows: Status Overview, Traffic & Errors, Resources, and Details, with tips on information flow, template variables, thresholds, and linking dashboards.
Best practices
  • Use template variables for service, namespace, and cluster so dashboards are reusable across environments.
  • Set meaningful thresholds and color rules to make issues obvious.
  • Link overview dashboards to service-specific dashboards for fast context switching.
  • Pre-build panels for common incident questions so responders avoid creating PromQL under pressure.
  • Keep panels focused: one question per panel.
Bringing it all together — quick checklist
The image presents key takeaways for setting up Grafana, focusing on its integration with Prometheus, datasource setup, panel type matching, and dashboard structuring.
Grafana visualizes metrics but does not store them long-term — ensure Prometheus retention, remote-write, or a long-term store is configured if you need extended history for investigations.

Watch Video