Book Image

Modern Distributed Tracing in .NET

By : Liudmila Molkova
Book Image

Modern Distributed Tracing in .NET

By: Liudmila Molkova

Overview of this book

As distributed systems become more complex and dynamic, their observability needs to grow to aid the development of holistic solutions for performance or usage analysis and debugging. Distributed tracing brings structure, correlation, causation, and consistency to your telemetry, thus allowing you to answer arbitrary questions about your system and creating a foundation for observability vendors to build visualizations and analytics. Modern Distributed Tracing in .NET is your comprehensive guide to observability that focuses on tracing and performance analysis using a combination of telemetry signals and diagnostic tools. You'll begin by learning how to instrument your apps automatically as well as manually in a vendor-neutral way. Next, you’ll explore how to produce useful traces and metrics for typical cloud patterns and get insights into your system and investigate functional, configurational, and performance issues. The book is filled with instrumentation examples that help you grasp how to enrich auto-generated telemetry or produce your own to get the level of detail your system needs, along with controlling your costs with sampling, aggregation, and verbosity. By the end of this book, you'll be ready to adopt and leverage tracing and other observability signals and tools and tailor them to your needs as your system evolves.
Table of Contents (23 chapters)
1
Part 1: Introducing Distributed Tracing
6
Part 2: Instrumenting .NET Applications
11
Part 3: Observability for Common Cloud Scenarios
16
Part 4: Implementing Distributed Tracing in Your Organization

Exploring auto-generated telemetry

The meme service is now up and running. Feel free to upload your favorite memes and if you see any issues, use telemetry to debug them!

Debugging

If you try to upload something right after the service starts, you might get an error like the one shown in Figure 2.8. Let’s figure out why!

Figure 2.8 – Error from application with traceparent

Figure 2.8 – Error from application with traceparent

We can approach this investigation from two angles. The first is to use the traceparent shown on the page; the second is to filter the traces from the frontend based on the error status.
In any case, let’s go to Jaeger – our tracing backend running on http://localhost:16686/. We can search by Trace ID or filter by service and error, as shown in Figure 2.9:

Figure 2.9 – Find the trace in Jaeger by Trace ID (1) or with a combination of the service (2) and error (3)

Figure 2.9 – Find the trace in Jaeger by Trace ID (1) or with a combination of the service (2) and error (3)

If we open the trace, we’ll see that...