Table Of ContentMastering Distributed Tracing
Analyzing performance in microservices and
complex systems
Yuri Shkuro
BIRMINGHAM - MUMBAI
Mastering Distributed Tracing
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded
in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing or its dealers and distributors, will be held liable for any damages
caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
Acquisition Editor: Andrew Waldron
Acquisition Editor - Peer Reviews: Suresh Jain
Project Editor: Tom Jacob
Content Development Editor: Joanne Lovell
Technical Editor: Gaurav Gavas
Proofreader: Safis Editing
Indexer: Mariammal Chettiyar
Graphics: Sandip Tadge, Tom Scaria
Production Coordinator: Sandip Tadge
First published: February 2019
Production reference: 1280219
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78862-846-4
www.packtpub.com
I dedicate this book to my family and my loving partner Yelena.
- Yuri Shkuro
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books
and videos, as well as industry leading tools to help you plan your personal
development and advance your career. For more information, please visit
our website.
Why subscribe?
• Spend less time learning and more time coding with practical eBooks
and Videos from over 4,000 industry professionals
• Learn better with Skill Plans built especially for you
• Get a free eBook or video every month
• Mapt is fully searchable
• Copy and paste, print, and bookmark content
Packt.com
Did you know that Packt offers eBook versions of every book published, with
PDF and ePub files available? You can upgrade to the eBook version at www.Packt.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at customercare@packtpub.com for more details.
At www.Packt.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters, and receive exclusive discounts and offers
on Packt books and eBooks.
Contributors
About the author
Yuri Shkuro is a software engineer at Uber Technologies, working on distributed
tracing, observability, reliability, and performance. He is the technical lead for Uber's
tracing team. Before Uber, Yuri spent 15 years on Wall Street, building trading and
risk management systems for derivatives at top investment banks, Goldman Sachs,
JPMorgan Chase, and Morgan Stanley.
Yuri's open source credentials include being a co-founder of the OpenTracing project,
and the creator and the tech lead of Jaeger, a distributed tracing platform developed
at Uber. Both projects are incubating at the Cloud Native Computing Foundation.
Yuri serves as an invited expert on the W3C Distributed Tracing working group.
Dr. Yuri Shkuro holds a Ph.D. in Computer Science from University of Maryland,
College Park, and a Master's degree in Computer Engineering from MEPhI
(Moscow Engineering & Physics Institute), one of Russia's top three universities.
He is the author of many academic papers in the area of machine learning and
neural networks; his papers have been cited in over 130 other publications.
Outside of his academic and professional career, Yuri helped edit and produce
several animated shorts directed by Lev Polyakov, including Only Love (2008), which
screened at over 30 film festivals and won several awards, Piper the Goat and the Peace
Pipe (2005), a winner at the Ottawa International Animation Festival, and others.
I'd like to say thank you to many people who made this book possible:
my producer Andrew, who reached out and convinced me to pursue this
book; my editors Tom and Joanne, who reviewed and edited my drafts;
my technical reviewer Pavol, who provided many great suggestions
on improving the book; Ben Sigelman, who helped me to structure the
content and from whom I learned a lot about tracing in general; Lev
Polyakov, the author of the Jaeger project's adorable logo, who made
brilliant illustrations for this book; and most of all, my family and my
partner Yelena, who supported me and put up with me working on the
book on weekends over many months.
About the reviewer
Pavol Loffay is a software engineer at Red Hat working on Observability tools for
microservice architectures. He is an active maintainer of the Jaeger and OpenTracing
projects. He is also a member of the OpenTracing Specification Council (OTSC) and
a lead for the MicroProfile OpenTracing specification. In his free time, Pavol likes to
travel and he is a passionate skier and rock climber.
About the illustrator
Lev Polyakov is an award winning independent animation director and conceptual
artist, whose films were featured on WNET 13, Channel Frederator, and ShortsHD.
Lev Polyakov has been active in the animation world since 2004, starting as
an intern for Signe Baumane, one of New York's most prominent independent
animators, and proceeding to write and direct his own animated films. His
first short, Piper the Goat and the Peace Pipe, won the first place at the 2005 Ottawa
Animation Festival. For his next film, Morning, Day, Evening, Night… and Morning
Again, Lev was awarded a grant and an honorary membership from the National
Board of Review of Motion Pictures. During his junior year at School of Visual Arts,
Lev directed and produced Only Love, a 15-minute animated short that premiered
at the prestigious Woodstock Film Festival, and has been shown at more than 30 film
festivals around the world, winning several first place awards.
Lev has done visually appealing, character-driven commercial work such
as storyboarding, character design, and animation for an iPad movie-book
Peter and the Wolf in Hollywood, produced by Giants Are Small in partnership
with Universal Music; and for the virtual reality studio, The Glimpse Group.
Lev is currently the Chair of the Art and Technology Committee at the National
Arts Club in New York City.
Packt is searching for authors like you
If you're interested in becoming an author for Packt, please visit authors.packtpub.
com and apply today. We have worked with thousands of developers and tech
professionals, just like you, to help them share their insight with the global tech
community. You can make a general application, apply for a specific hot topic
that we are recruiting an author for, or submit your own idea.
Table of Contents
Preface ix
Part I: Introduction 1
Chapter 1: Why Distributed Tracing? 3
Microservices and cloud-native applications 4
What is observability? 7
The observability challenge of microservices 8
Traditional monitoring tools 11
Metrics 11
Logs 12
Distributed tracing 13
My experience with tracing 15
Why this book? 18
Summary 20
References 20
Chapter 2: Take Tracing for a HotROD Ride 23
Prerequisites 24
Running from prepackaged binaries 24
Running from Docker images 25
Running from the source code 25
Go language development environment 26
Jaeger source code 26
Start Jaeger 27
Meet the HotROD 29
The architecture 32
The data flow 33
[ i ]