تجهيز خدمات Spring بالأدوات
في هذا الدرس 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.
تفاصيل المخطط المبدئي
عرض عملي
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.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.