Build a Grafana Dashboard
Visualize service health at a glance.
Build a Grafana Dashboard is a free MLOps Academy lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the MLOps Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
From Numbers to Pictures
Prometheus stores your metrics, but raw numbers are hard to read. Grafana turns them into charts you can actually understand at a glance. 📊
Grafana Plus Prometheus
Grafana does not store data itself. It queries a data source like Prometheus and draws whatever that source returns.
Add the Data Source
First step in Grafana is connecting Prometheus as a data source. You give it the Prometheus server URL and test the connection.
# Grafana > Connections > Data sources
# URL: http://prometheus:9090Dashboards and Panels
A dashboard is a screen of panels. Each panel is one chart driven by one query, so you compose a full view from small pieces.
Query with PromQL
Panels ask Prometheus questions in PromQL, its query language. This is where you turn stored metrics into a meaningful line.
Chart the Request Rate
The rate function shows per-second change of a counter over a window. It is the classic way to plot traffic to your model.
rate(predictions_total[5m])Chart the Error Ratio
Divide error rate by total rate to plot an error ratio. A rising line here means more requests are failing.
rate(errors_total[5m]) / rate(predictions_total[5m])Chart p99 Latency
From your latency histogram, compute the 99th percentile so you see the slow tail, not just the average.
histogram_quantile(0.99, rate(predict_seconds_bucket[5m]))Use Big Stat Panels
For single numbers like current error rate, a stat panel shows one large value and can flash red past a threshold. ⚠️
Variables Make It Reusable
Add a dashboard variable for model version, then one dashboard works for every model instead of copying it per version.
rate(predictions_total{model="$model"}[5m])Save It as Code
Every dashboard can be exported to JSON. Commit that file to Git so your dashboards are versioned and reproducible like the rest of your stack.
Quick Check
You want a Grafana panel showing per-second request traffic to your model from a counter. Which PromQL fits?
Recap
You connected Grafana to Prometheus, built panels with PromQL for rate, errors, and p99 latency, and saved the dashboard as JSON in Git. ✅
Frequently asked questions
Is the “Build a Grafana Dashboard” lesson free?
Yes — the full text of “Build a Grafana Dashboard” is free to read here on the web, and the MLOps Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the MLOps Academy course, upgrade to CoddyKit PRO.
What will I learn in “Build a Grafana Dashboard”?
Visualize service health at a glance. You practise MLOps Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start MLOps Academy?
No prior experience is required. MLOps Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Build a Grafana Dashboard” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this MLOps Academy lesson?
Yes. Every MLOps Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Structured Logs for Predictions
- Expose Metrics with Prometheus
- Build a Grafana Dashboard
- Alert on Latency and Error Spikes