Company
Date Published
Author
Dotan Horovits
Word count
1792
Language
English
Hacker News points
None

Summary

OpenTelemetry is a recommended approach for instrumenting applications with distributed tracing in a standardized and vendor-neutral manner, offering a stable tracing specification and encompassing metrics and logs as well. The article provides a comprehensive guide to implementing OpenTelemetry tracing in an ASP.NET Core 3.1 application using the OpenTelemetry .NET SDK, detailing steps such as adding necessary packages, configuring the trace provider, setting up an OpenTelemetry Collector, and exporting traces to a backend like Logz.io’s managed Jaeger service. The example involves two ASP.NET Core Web APIs, Service A and Service B, which communicate via HTTP requests, with spans emitted and collected by the OpenTelemetry Collector before being visualized in the Jaeger UI. Both automatic and manual instrumentation options are discussed, including the addition of user-defined context with baggage, allowing for the tracking and tagging of trace information across service boundaries. The guide emphasizes the ease of integration and the ability to achieve finer-grain tracing by manually adding spans, making it a valuable resource for developers seeking to enhance observability in their .NET applications.