انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-047-L04

تجهيز خدمات Spring بالأدوات

  • الدرس 4 من 9
  • Mid-level
في هذا الدرس 4 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

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

في هذا الدرس

add traces to a Spring Boot service.

الموضوعات المخطط لها

  • Auto-instrumentation (Java agent or Spring Boot's Micrometer Tracing with an OTel bridge) covers HTTP, JDBC, and Kafka clients. Verify the supported setup for the Boot version in use before recording.
  • Manual spans add business steps: "reserve-stock", "charge-payment".
  • Add useful attributes (order id as span attribute is fine; as a metric label it is not).
  • Configure the exporter endpoint and sampling through properties or environment variables.
تفاصيل المخطط المبدئي

عرض عملي

java
Span span = tracer.spanBuilder("reserve-stock").startSpan();
try (Scope s = span.makeCurrent()) { span.setAttribute("order.id", id); inventory.reserve(lines); }
finally { span.end(); }

اختبر فهمك

When do you need a manual span?

أظهر الإجابة

For a business step the auto-instrumentation cannot see.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

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

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

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