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

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “Another option is to pass the traceparent value in W3C Trace Context format to the StartActivity method as a string.”

A block of code is set as follows:

using var activity = Source.StartActivity("DoWork");
try
{
  await DoWorkImpl(workItemId);
}
catch
{
  activity?.SetStatus(ActivityStatusCode.Error);
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

using var provider = Sdk.CreateTracerProviderBuilder()
  .ConfigureResource(b => b.AddService("sample"))
  .AddSource("Worker")
  .AddJaegerExporter()

Any command-line input or output is written as follows:

$ docker-compose up --build
$ dotnet run

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “Let’s open the trace file with PerfView and then click on the Thread Time option.”

Tips or important notes

Appear like this.