Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed...
Transcript of Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed...
![Page 1: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/1.jpg)
Distributed Tracing in Practice
Priit Potter
![Page 2: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/2.jpg)
What is Plumbr?
• Real User Monitoring + Application Performance Monitoring
• Tracks all user interactions in the front-end
• Detects bottlenecks and errors in the back-end and maps to real user experience
![Page 3: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/3.jpg)
Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially those built using a microservices architecture.Source: Opentracing manual
![Page 4: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/4.jpg)
![Page 5: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/5.jpg)
![Page 6: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/6.jpg)
From: John The CustomerTo: [email protected]: Cannot complete checkout
I just tried to complete my order #32828, but was unable to finish the checkout process. Your app stalled for 20 seconds and then gave me an error.
![Page 7: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/7.jpg)
![Page 8: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/8.jpg)
The 4 rules of distributed tracing
• Every request gets a unique ID
• The ID is passed along to all microservices handling the request
• Every microservice registers the duration and outcome
• Monitoring data is sent to a central server
![Page 9: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/9.jpg)
![Page 10: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/10.jpg)
![Page 11: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/11.jpg)
Example #1: response to our supportticket
![Page 12: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/12.jpg)
![Page 13: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/13.jpg)
Lesson #1: a distributed application callsfor distributed tracing :)
![Page 14: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/14.jpg)
Example #2: smarter response to oursupport ticket
![Page 15: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/15.jpg)
![Page 16: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/16.jpg)
![Page 17: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/17.jpg)
![Page 18: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/18.jpg)
Lesson #2: for faster impact analysis, adderror/bottleneck information to traces
![Page 19: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/19.jpg)
Example #3: the smartest response to oursupport ticket
![Page 20: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/20.jpg)
![Page 21: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/21.jpg)
![Page 22: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/22.jpg)
![Page 23: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/23.jpg)
Lesson #3: for most efficient impactanalysis, include frontend traces too
![Page 24: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/24.jpg)
![Page 25: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/25.jpg)
Zipkin PHP example$tracing = create_tracing('php-frontend', '127.0.0.1');$tracer = $tracing->getTracer();$request = \Symfony\Component\HttpFoundation\Request::createFromGlobals();
/* Extract the context from HTTP headers */$carrier = array_map(function ($header) {
return $header[0];}, $request->headers->all());$extractor = $tracing->getPropagation()->getExtractor(new Map());$extractedContext = $extractor($carrier);
/* Create a span and set its attributes */$span = $tracer->newChild($extractedContext);$span->start(Timestamp\now());$span->setName('parse_request');$span->setKind(Zipkin\Kind\SERVER);
![Page 26: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/26.jpg)
Zipkin PHP example
![Page 27: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/27.jpg)
-javaagent:path-to/plumbr.jar
<script src="https://browser.plumbr.io/pa.js" crossorigin="anonymous"data-plumbr='{"accountId":"k8g0ta8m6e7gsb2afhq6qm5efh","appName":"REPLACE_WITH_YOUR_APPLICATION_NAME", "serverUrl":"https://bdr.plumbr.io"
}'></script>
![Page 28: Distributed Tracing in Practice - GOTO Conference · Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, especially](https://reader033.fdocuments.us/reader033/viewer/2022042306/5ed220ccd4113d0f84097ab0/html5/thumbnails/28.jpg)