Skip to Main Content
Mastering Distributed Tracing
book

Mastering Distributed Tracing

by Yuri Shkuro
February 2019
Intermediate to advanced content levelIntermediate to advanced
444 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Distributed Tracing

Exercise 2 – the first trace

Now that we are familiar with the sample application, let's add some very basic instrumentation to it to create a trace for each HTTP request that it handles. We will do it in three steps:

  1. Create a tracer instance
  2. Start a span in the HTTP handler function
  3. Annotate the span with additional details in a few places in the code

Step 1 – create a tracer instance

As mentioned, OpenTracing is just an API, so we need to instantiate a concrete implementation of the tracer. We will be using the Jaeger tracer as an example, but the function that creates the tracer will be the only place in the whole program that is Jaeger-specific. It can be easily replaced with any other OpenTracing-compatible tracer, such as Zipkin or tracers from ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Distributed Tracing in Practice

Distributed Tracing in Practice

Austin Parker, Daniel Spoonhower, Jonathan Mace, Ben Sigelman, Rebecca Isaacs
Kafka: The Definitive Guide, 2nd Edition

Kafka: The Definitive Guide, 2nd Edition

Gwen Shapira, Todd Palino, Rajini Sivaram, Krit Petty

Publisher Resources

ISBN: 9781788628464Supplemental Content