انتقل إلى المحتوى
أمين أبوزيد
MID-048

المراقبة (Monitoring)

  • 5 درس
  • 2.5 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • Prometheus
  • Grafana
  • لوحات المعلومات
  • التنبيهات

تعلّم أولًا

2.5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Scrape metrics with Prometheus and write PromQL for rates, ratios, and percentiles.
  2. Build Grafana dashboards using the RED and USE methods.
  3. Write alerts on symptoms rather than causes, with clear runbook links.

الدروس

  1. 01نموذج Prometheus
  2. 02أساسيات PromQL
  3. 03لوحات المعلومات: RED وUSE
  4. 04تنبيهات يثق بها الناس
  5. 05عرض عملي: لوحة معلومات لخدمة من الصفر

المختبر والتمارين

Lab

MID-048-LAB1 · Shop dashboards

Outcomes: 1–3 · Time: ~2.5 h Build one dashboard per service plus a business overview. Add alerts for error rate and latency, each with a runbook. Acceptance: a fault injected by the instructor triggers exactly one actionable alert.

Exercises (assessment: dashboard and alert review)

IDOutcomeTask
MID-048-EX011Configure Prometheus to scrape a Shop service and confirm the target is up.
MID-048-EX021Write PromQL for request rate, error ratio, and p95 latency of orders.
MID-048-EX031Explain why rate() is needed for counters and what a range of [5m] means.
MID-048-EX042Build a RED dashboard and a USE row (heap, GC, DB pool) for one service.
MID-048-EX053Write an error-rate alert with for:, severity, and a runbook link.
MID-048-EX063Rewrite a CPU-above-80% alert as a symptom-based alert.
MID-048-EX072–3Review a given dashboard and alert set: list what to delete, fix, and add.
أظهر الحلول
  • EX01 Add a scrape config or a service/pod monitor; the targets page shows UP.
  • EX02 Rate: sum(rate(..._count[5m])); ratio as in the lecture; p95 with histogram_quantile.
  • EX03 Counters only increase and reset on restart; rate gives per-second increase over the window and handles resets.
  • EX04 Panels: rate, errors, p50/p95/p99, heap used, GC pause, pool active versus max.
  • EX05 expr on the error ratio, for: 5m, label severity: page, annotation runbook_url.
  • EX06 Alert on checkout error ratio and p95 latency; keep CPU as a dashboard panel (cause), not a page.
  • EX07 Typical findings: averages, no runbook links, alerts on causes, duplicate alerts for one fault.

Outcome 3 is also checked by the lab criterion "exactly one actionable alert".

الاختبار

Outcomes: O1 Prometheus and PromQL · O2 dashboards (RED and USE) · O3 alerting.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1Prometheus collects metrics by:O1
  2. 2A counter is read with:O1
  3. 3Which gives an error percentage?O1
  4. 4histogram_quantile(0.95, ...) returns:O1
  5. 5RED stands for:O2
  6. 6USE dashboards cover:O2
  7. 7A dashboard nobody reads should be:O2
  8. 8Alerts should be based mainly on:O3
  9. 9Every actionable alert has:O3
  10. 10The for: clause in an alert rule:O3

الجزء العملي

Seven exercises MID-048-EX01 to EX07 (EX07 is the dashboard and alert review) plus the dashboards lab. Pass: at least five exercises and a lab where an injected fault triggers exactly one actionable alert.

أخطاء شائعة

Alerting on CPU; dashboards nobody reads; alerts without runbooks.

التقييم

Dashboard and alert review.

الصلة بالمسار الوظيفي

SLO engineering (SRC-012).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.