Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Modern Distributed Tracing in .NET

You're reading from   Modern Distributed Tracing in .NET A practical guide to observability and performance analysis for microservices

Arrow left icon
Product type Paperback
Published in Jun 2023
Publisher Packt
ISBN-13 9781837636136
Length 336 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Liudmila Molkova Liudmila Molkova
Author Profile Icon Liudmila Molkova
Liudmila Molkova
Arrow right icon
View More author details
Toc

Table of Contents (23) Chapters Close

Preface 1. Part 1: Introducing Distributed Tracing
2. Chapter 1: Observability Needs of Modern Applications FREE CHAPTER 3. Chapter 2: Native Monitoring in .NET 4. Chapter 3: The .NET Observability Ecosystem 5. Chapter 4: Low-Level Performance Analysis with Diagnostic Tools 6. Part 2: Instrumenting .NET Applications
7. Chapter 5: Configuration and Control Plane 8. Chapter 6: Tracing Your Code 9. Chapter 7: Adding Custom Metrics 10. Chapter 8: Writing Structured and Correlated Logs 11. Part 3: Observability for Common Cloud Scenarios
12. Chapter 9: Best Practices 13. Chapter 10: Tracing Network Calls 14. Chapter 11: Instrumenting Messaging Scenarios 15. Chapter 12: Instrumenting Database Calls 16. Part 4: Implementing Distributed Tracing in Your Organization
17. Chapter 13: Driving Change 18. Chapter 14: Creating Your Own Conventions 19. Chapter 15: Instrumenting Brownfield Applications 20. Assessments 21. Index 22. Other Books You May Enjoy

What this book covers

Chapter 1, Observability Needs of Modern Applications, provides an overview of common monitoring techniques and introduces distributed tracing. It covers OpenTelemetry – a vendor-agnostic telemetry platform and shows how it addresses observability challenges of distributed applications with correlated telemetry signals.

Chapter 2, Native Monitoring in .NET, offers an overview of the diagnostic capabilities provided by .NET out-of-the-box. These capabilities include structured and correlated logs and counters along with ad-hoc monitoring with the dotnet-monitor tool. We’ll also instrument the first application with OpenTelemetry and get hands-on experience with distributed tracing.

Chapter 3, The .NET Observability Ecosystem, explores a broader set of tracing instrumentations and environments. We’ll learn how to find and evaluate instrumentation libraries, get traces from infrastructure such as Dapr, and finally instrument serverless applications using AWS Lambda and Azure Functions as examples.

Chapter 4, Low-Level Performance Analysis with Diagnostic Tools, provides an introduction into lower-level .NET diagnostics and performance analysis. We’ll see how to collect and analyze runtime counters and performance traces to get more observability within the process when distributed tracing does not provide enough input.

Chapter 5, Configuration and Control Plane, provides an overview of OpenTelemetry configuration and customization. We’ll explore different sampling strategies and learn how to enrich and filter spans or customize metrics collection. Finally, we’ll introduce OpenTelemetry Collector – an agent that can take care of many telemetry post-processing tasks.

Chapter 6, Tracing Your Code, dives into tracing instrumentation with .NET tracing APIs or OpenTelemetry shim. Here, we’ll learn about the Activity and ActivitySource classes used to collect spans, show how to leverage ambient context propagation within the process, and record events and exceptions. We’ll also cover integration testing for your instrumentation code.

Chapter 7, Adding Custom Metrics, delves into the modern .NET metrics API. You’ll learn about available instruments - counters, gauges, and histograms used to aggregate measurements in different ways and get hands-on experience implementing and using metrics to monitor system health or to investigate performance issues.

Chapter 8, Writing Structured and Correlated Logs, provides an overview of logging in .NET focusing on Microsoft.Extension.Logging. We’ll learn to write structured and queryable logs efficiently and collect them with OpenTelemetry. We’ll also look into managing logging costs using OpenTelemetry Collector.

Chapter 9, Best Practices, provides guidance on choosing most suitable telemetry signals depending on application needs and scenarios, and shows how to control telemetry costs with minimal impact on observability. It also introduces OpenTelemetry semantic conventions – telemetry collection recipes for common patterns and technologies.

Chapter 10, Tracing Network Calls, explores network call instrumentation using gRPC as an example. We’ll learn how to instrument simple request-response calls following RPC semantic conventions and propagate context. We’ll also cover challenges and possible solutions when instrumenting streaming calls.

Chapter 11, Instrumenting Messaging Scenarios, explores instrumentation for asynchronous processing scenarios. We’ll learn how to trace messages end-to-end, instrument batching scenarios, and introduce messaging-specific metrics allowing to detect scaling and performance issues.

Chapter 12, Instrumenting Database Calls, explores database and cache instrumentation with tracing and metrics. We’ll also cover forwarding external metrics from a Redis instance into our observability backend and use the collected telemetry for performance analysis and caching strategy optimization.

Chapter 13, Driving Change, covers organizational and planning aspects related to observability improvements. We’ll discuss the cost of low observability and suggest several ways to measure them. We’ll come up with an onboarding plan, talk about common pitfalls, and see how to benefit from better observability in daily development tasks.

Chapter 14, Creating Your Own Conventions, provides suggestions on how to collect telemetry consistently across the system starting with a unified OpenTelemetry configuration. We’ll also learn to define custom semantic conventions and implement them in shared code, making it easy to follow them.

Chapter 15, Instrumenting Brownfield Applications, discusses challenges with instrumenting newer part of the system in presence of legacy services. We’ll suggest solutions that can minimize changes to legacy components and learn to leverage legacy correlation propagation formats, implement minimalistic pass-through context propagation, and forward telemetry from legacy services to the new backend.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime