สร้างแดชบอร์ด Grafana
แสดงภาพสุขภาพของบริการได้อย่างรวดเร็ว
สร้างแดชบอร์ด Grafana เป็นบทเรียน MLOps Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน MLOps Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
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. ✅
คำถามที่พบบ่อย
บทเรียน “สร้างแดชบอร์ด Grafana” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “สร้างแดชบอร์ด Grafana” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส MLOps Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “สร้างแดชบอร์ด Grafana”
แสดงภาพสุขภาพของบริการได้อย่างรวดเร็ว คุณปฏิบัติ MLOps Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน MLOps Academy หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน MLOps Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 3 จากทั้งหมด 4 บทเรียน
บทเรียน “สร้างแดชบอร์ด Grafana” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน MLOps Academy นี้ได้ไหม
ได้ บทเรียน MLOps Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- บันทึกผลพยากรณ์แบบมีโครงสร้าง
- เปิดเผยเมตริกด้วย Prometheus
- สร้างแดชบอร์ด Grafana
- แจ้งเตือนเมื่อเวลาแฝงและข้อผิดพลาดพุ่งสูง