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

قابلية الرصد (Observability)

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

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

نظرة عامة

الموضوعات

  • السجلات (Logs)
  • المقاييس (Metrics)
  • التتبّعات (Traces)
  • معرّفات الارتباط (correlation IDs)
  • OpenTelemetry

تعلّم أولًا

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

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

  1. Explain the roles of logs, metrics, and traces and the questions each answers.
  2. Instrument services with OpenTelemetry (auto and manual spans) and propagate context over HTTP and Kafka.
  3. Correlate logs with traces through trace and span IDs.
  4. Add business-meaningful custom metrics with Micrometer.

الدروس

  1. 01المراقبة مقابل قابلية الرصد
  2. 02السجلات والمقاييس والتتبّعات
  3. 03مفاهيم OpenTelemetry
  4. 04تجهيز خدمات Spring بالأدوات
  5. 05نشر السياق عبر Kafka
  6. 06ربط السجلات بالتتبّعات
  7. 07مقاييس مخصصة باستخدام Micrometer
  8. 08عرض عملي: تتبّع طلب واحد عبر أربع خدمات
  9. 09عرض عملي: إيجاد span بطيء في ساغا

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

Lab

MID-047-LAB1 · Traceable Shop

Outcomes: 1–4 · Time: ~3.5 h Instrument gateway, services, and Kafka so traces appear in Jaeger or Tempo; add trace ids to logs; add business metrics for orders placed and failed. Acceptance: any order ID can be traced end to end.

Exercises (assessment: diagnose an issue from telemetry alone)

IDOutcomeTask
MID-047-EX011For five questions (error count, request path, exact exception, time per step, slow tail), name the signal that answers it.
MID-047-EX022Enable auto-instrumentation for orders and view a trace in Jaeger or Tempo.
MID-047-EX032Add a manual span "reserve-stock" with an order.id attribute.
MID-047-EX042Propagate trace context through Kafka and show one trace across producer and consumer.
MID-047-EX053Add trace_id and span_id to JSON logs; find all logs of one request.
MID-047-EX064Add a counter shop.orders tagged result; explain why customerId must not be a tag.
MID-047-EX071–4Given screenshots of traces, logs, and metrics from a slow-checkout incident, write a diagnosis with evidence.
أظهر الحلول
  • EX01 Counts: metric; path: trace; exact exception: log; time per step: trace; slow tail: metric histogram or percentile.
  • EX02 Run the OTel Java agent or the Micrometer Tracing bridge with an exporter to the collector; verify the supported setup for the Boot version.
  • EX03 tracer.spanBuilder(...) with makeCurrent() and end() in finally, as in the lecture.
  • EX04 Use the instrumented Kafka client or Spring Kafka observation support so headers carry traceparent; check the consumer span's trace id equals the producer's.
  • EX05 Add trace and span ids to the MDC through the tracing bridge and a JSON encoder; search by trace id.
  • EX06 Counter.builder("shop.orders").tag("result","failed"); customer id yields unbounded series.
  • EX07 Pattern: symptom (metric), narrowing (traces), cause (widest span), confirmation (logs); propose one fix.

Outcome 1 is also checked by quiz Q01-Q03.

الاختبار

Outcomes: O1 logs, metrics, traces · O2 OpenTelemetry and propagation · O3 log-trace correlation · O4 custom metrics.

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

  1. 1Which signal shows where a request spent its time across services?O1
  2. 2Counting orders is best done with:O1
  3. 3Observability differs from monitoring because it:O1
  4. 4A trace is made of:O2
  5. 5Trace context between HTTP services travels in:O2
  6. 6A trace that stops at the broker usually means:O2
  7. 7A manual span is useful for:O2
  8. 8To join logs to traces, each log line needs:O3
  9. 9Which is a safe metric tag?O4
  10. 10Why avoid high-cardinality labels?O4

الجزء العملي

Seven exercises MID-047-EX01 to EX07 (EX07 is the diagnosis from telemetry alone) plus the Traceable Shop lab. Pass: at least five exercises including EX07, and a lab where any order id can be traced end to end.

أخطاء شائعة

High-cardinality metric labels; traces broken at the message broker; logging instead of metrics for counts.

التقييم

Diagnose an issue from telemetry alone.

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

Incident handling (MID-050) and the MID gate.

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