SlideShare a Scribd company logo
1 of 40
Download to read offline
{ Tracing performance with some help of
Sleuth, Zipkin & ELK }
Rafaëla Breed
Amsterdam | April 2-3, 2019
Rafaëla Breed
• So#ware engineer @ Luminis Amsterdam
• Java developer
• Spring(Boot)
• Photography, traveling
Hmmm… breakfast
New company, new application
Let’s just start developing our applica4on
Everything works fine, but…
…there comes the tester/business/client: !
“It does not work” "
“So, what does not work?” #
“Well, it is slow” $
“All right, do you know which step is being slow exactly?” #
“When I push the toast bu>on, it takes 5 seconds to get the results.
That is way too slow. We have to service our customers as fast as possible and
……” %
Microservice
Microservice
Microservice
MicroserviceMicroservice
What do we know?
Breakfast service
Get toasted bread
Machine service
Get toaster
informa/on
Energy service
Get power usage
Temperature
service
Get temperature
Preference service
Get preference of
toast
Request Request
Request
Request
Request
Response
Response
Response Response
Response
What do we have?
ELK: Elas)cSearch, Logstash, Kibana
• Applica(ons
• Collect
• Parse
• Transform
• Store
• Search
• Analyze • Visualize
• Explore
Maven Logback GELF
dependency
Kibana
Log messages of the applications
Fields used
in logs
Filters
Search
Let’s try & dive in our logging
Summary of demo
• Easy search & filter by ELK
• But… Not easy to track specific events… yet
What we would like to have
•Correlation between operations
•Each starting operation => unique id
•Each next operation => unique id
What Sleuth can offer
• Depicted from Dapper Infrastructure, Zipkin, Htrace
• Implementable via Maven/Gradle
• Brave is used as tracing library
• Every first remote call starts a trace (aka uber-span)
• Every following remote call starts a span (aka child span)
• Traces are passed to next service(s)
Adding Sleuth to your project
• To every SpringBoot app we add:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<ar@factId>spring-cloud-sleuth</ar@factId>
<version>${spring.cloud.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<ar@factId>spring-cloud-starter-sleuth</ar@factId>
</dependency>
</dependencies>
• Or take a look at
https://cloud.spring.io/spring-
cloud-sleuth/
• Using custom log appender(s)?
Add the properties X-B3-TraceId
and X-B3-SpanId to your
configuration!
Trace
Summary
of demo
Span E
Parent Span A
Span D
Parent Span B
Span C
Parent Span B
Span B
Parent Span A
Span A
Request Request
Request
Request
Request
Response
Response
Response Response
Response
Breakfast service
Get toasted bread
Machine service
Get toaster
informa/on
Energy service
Get power usage
Temperature
service
Get temperature
Preference service
Get preference of
toast
Summary of demo
Zipkin
• Developed by Twitter in 2012
• Adapted and open-sourced in 2015 as OpenZipkin
• Distributed tracing system
• Trace down your system(s)
Adding Zipkin client to your project
• To every SpringBoot app we add:
<!-- Assuming you already added the spring cloud sleuth dependency in
your dependencyManagement -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<arDfactId>spring-cloud-starter-zipkin</arDfactId>
</dependency>
Sampler for Zipkin
• Do you want to put each request into Zipkin?
• Up-front decision
• Probability 0…1 à chance 0 to 100%
• Default = ProbabilityBasedSampler 0.1
• ALWAYS_SAMPLE
• Custom declaraHve sampling
• Custom sampling on request
• Rate-limiHng sampler
• X-B3-Flags overrides (client request header)
Getting a Zipkin server
• Github project
• Docker images (production ready)
• Cloud solutions for AWS/Azure available
Zipkin Server
Collector Storage API UI
Summary of demo
• The Zipkin client sends enriched information of Sleuth to your Zipkin
Server
• The Zipkin Server provides a user interface in which you can overview
the details of the events logged by Sleuth/Zipkin Client
Summary of demo
• The user interface with clear graphics of events with 2mes
Overview what will happen (a bit under the hood)
Spring boot applica.on
Spring Cloud Sleuth
Spring Cloud Zipkin
Brave’s
Tracing
Zipkin’s
Reporter
Traces, span
Zipkin server
Sampler
Zipkin’s
Sender ->
[KAFKA, RABBIT, WEB]
Our Cucumber tests
• TDD, business scenario’s
• Logs tests & apps available
Our test log
Our test report
Our application logs
“Über-trace” aka conversa1on
Trace Microservice
Trace
Trace
Our future wishes
Request
Response
Microservice
Breakfast service
Get toasted bread
+
Request
Microservice
Response
Breakfast service
Get fried egg
+
Request
Response
Breakfast service
Get fried bacon
Trace
RequestResponse
Microservice
Breakfast service
Get coffee
Conversa)on ID specs
• Client may pass request header as X-B3-ConvID
• If not passed à application creates it
• Subsequent calls of services receive it & use it
• Loggable & passed to Zipkin à searchable
• Client response header has X-B3-ConvID
Adding a custom tracefilter
• Extend your class with GenericFilterBean
• Ensure that the @Order is before or a'er
TraceWebServletAutoConfigura>on.TRACING_FILTER_ORDER,
dependent on what you want to provide
Propaga'on fields
• Or bagage
• Addable fields passed through services with trace and every span
Trace
Microservice
Span
Microservice
Span
X-B3-CONVID
X-B3-CONVID
X-B3-CONVID
Tags
• Addable fields for specific span for details / lookup
• Will be passed to Zipkin
Microservice
Span
Zipkin server
X-B3-CONVID
X-B3-CONVID
X-B3-CONVID
Summary of demo
• Manipulate pass through of Sleuth with a custom filter
• Propaga+on fields will be passed to the whole trace
• A tag is used to tag a span & is also passed to Zipkin
• Make conversa<on id or trace id available in your reports!
But…
…what about applications without Spring Boot?
…what about applications without Java?
…are there alternatives to Zipkin?
Distributed tracing
opencencus.io & opentracing.io
Summary
• Easy review of application calls with ELK, Sleuth, Zipkin
• More clear separation of events by traces & spans with Sleuth
• More easy search for performance latencies by visualization in Zipkin
• Extra information by extra custom interceptors/filters
• Logging and tracing will go hand-in-hand
Golden circle of observability
Thank you for your ,me!
• Ques%ons?
• Please give feedback in the app
• Presenta%on & code at
h:ps://github.com/RDBreed/sleuthzipkindemo
Observability & serverless?
14:10-14:50 by Yan Cui @ room 2

More Related Content

What's hot

What's hot (20)

Android Pro Tips - IO 13 reloaded Event
Android Pro Tips - IO 13 reloaded EventAndroid Pro Tips - IO 13 reloaded Event
Android Pro Tips - IO 13 reloaded Event
 
Aptana Jaxer
Aptana JaxerAptana Jaxer
Aptana Jaxer
 
Continuous delivery & Alfresco - Living in the fast lane
Continuous delivery & Alfresco - Living in the fast lane Continuous delivery & Alfresco - Living in the fast lane
Continuous delivery & Alfresco - Living in the fast lane
 
Android advanced client architecture
Android advanced client architectureAndroid advanced client architecture
Android advanced client architecture
 
What's new in FME 2019: FME Server
What's new in FME 2019: FME ServerWhat's new in FME 2019: FME Server
What's new in FME 2019: FME Server
 
Automation Keys: What They Are and Why You Should Use Them
Automation Keys: What They Are and Why You Should Use ThemAutomation Keys: What They Are and Why You Should Use Them
Automation Keys: What They Are and Why You Should Use Them
 
What's new in FME 2019: FME Desktop
What's new in FME 2019: FME DesktopWhat's new in FME 2019: FME Desktop
What's new in FME 2019: FME Desktop
 
AWS Kochi User Group Presentation
AWS  Kochi User Group PresentationAWS  Kochi User Group Presentation
AWS Kochi User Group Presentation
 
Migration of a legacy project to Symfony
Migration of a legacy project to SymfonyMigration of a legacy project to Symfony
Migration of a legacy project to Symfony
 
Gearman Add To Your Project
Gearman Add To Your ProjectGearman Add To Your Project
Gearman Add To Your Project
 
Asynchronous Programming
Asynchronous ProgrammingAsynchronous Programming
Asynchronous Programming
 
Automating with FME 2019
Automating with FME 2019Automating with FME 2019
Automating with FME 2019
 
FME Server 2021.0 at Scale: Advanced Job Control
FME Server 2021.0 at Scale: Advanced Job ControlFME Server 2021.0 at Scale: Advanced Job Control
FME Server 2021.0 at Scale: Advanced Job Control
 
My radio
My radioMy radio
My radio
 
Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015Running operations in 2 hours at DevTernity 2015
Running operations in 2 hours at DevTernity 2015
 
Webinar Getting Started with FME Desktop: Your Burning Questions Answered
 Webinar Getting Started with FME Desktop: Your Burning Questions Answered Webinar Getting Started with FME Desktop: Your Burning Questions Answered
Webinar Getting Started with FME Desktop: Your Burning Questions Answered
 
Design & Prototype an API
Design & Prototype an APIDesign & Prototype an API
Design & Prototype an API
 
BeyondAutomation
BeyondAutomationBeyondAutomation
BeyondAutomation
 
Self hosted autoresponder
Self hosted autoresponderSelf hosted autoresponder
Self hosted autoresponder
 
Authoring with FME 2019
Authoring with FME 2019Authoring with FME 2019
Authoring with FME 2019
 

Similar to Rafaëla Breed - Tracing performance of your service calls - Codemotion Amsterdam 2019

Similar to Rafaëla Breed - Tracing performance of your service calls - Codemotion Amsterdam 2019 (20)

AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo  AWS Webcast - AWS OpsWorks Continuous Integration Demo
AWS Webcast - AWS OpsWorks Continuous Integration Demo
 
Going Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
Going Cloud Native with IBM Cloud and NetflixOSS for Dev@PulseGoing Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
Going Cloud Native with IBM Cloud and NetflixOSS for Dev@Pulse
 
Case Study: Appriss Supercharges ITSM Efficiency With Process Automation to...
Case Study: Appriss Supercharges ITSM Efficiency With Process Automation to...Case Study: Appriss Supercharges ITSM Efficiency With Process Automation to...
Case Study: Appriss Supercharges ITSM Efficiency With Process Automation to...
 
Azure Spring Cloud Workshop - June 17, 2020
Azure Spring Cloud Workshop - June 17, 2020Azure Spring Cloud Workshop - June 17, 2020
Azure Spring Cloud Workshop - June 17, 2020
 
Moving Your Business to Azure
Moving Your Business to AzureMoving Your Business to Azure
Moving Your Business to Azure
 
Webinar - Order out of Chaos: Avoiding the Migration Migraine
Webinar - Order out of Chaos: Avoiding the Migration MigraineWebinar - Order out of Chaos: Avoiding the Migration Migraine
Webinar - Order out of Chaos: Avoiding the Migration Migraine
 
AWS Public Sector Symposium 2014 Canberra | Continuous Integration and Deploy...
AWS Public Sector Symposium 2014 Canberra | Continuous Integration and Deploy...AWS Public Sector Symposium 2014 Canberra | Continuous Integration and Deploy...
AWS Public Sector Symposium 2014 Canberra | Continuous Integration and Deploy...
 
Leveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIsLeveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIs
 
Using Security to Build with Confidence in AWS - Trend Micro
Using Security to Build with Confidence in AWS - Trend Micro Using Security to Build with Confidence in AWS - Trend Micro
Using Security to Build with Confidence in AWS - Trend Micro
 
DevOps and AWS
DevOps and AWSDevOps and AWS
DevOps and AWS
 
Advanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWSAdvanced Continuous Delivery on AWS
Advanced Continuous Delivery on AWS
 
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
 
App fabric introduction
App fabric introductionApp fabric introduction
App fabric introduction
 
VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...
VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...
VMworld 2013: Moving Enterprise Application Dev/Test to VMware’s Internal Pri...
 
[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric Cloud[India Merge World Tour] Electric Cloud
[India Merge World Tour] Electric Cloud
 
Angular 2 overview in 60 minutes
Angular 2 overview in 60 minutesAngular 2 overview in 60 minutes
Angular 2 overview in 60 minutes
 
20171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v0120171122 aws usergrp_coretech-spn-cicd-aws-v01
20171122 aws usergrp_coretech-spn-cicd-aws-v01
 
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
 
DEVNET-1184 Microservices Patterns
DEVNET-1184	Microservices PatternsDEVNET-1184	Microservices Patterns
DEVNET-1184 Microservices Patterns
 
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
AIM410R Deep Learning Applications with TensorFlow, featuring Mobileye (Decem...
 

More from Codemotion

More from Codemotion (20)

Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
Fuzz-testing: A hacker's approach to making your code more secure | Pascal Ze...
 
Pompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending storyPompili - From hero to_zero: The FatalNoise neverending story
Pompili - From hero to_zero: The FatalNoise neverending story
 
Pastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storiaPastore - Commodore 65 - La storia
Pastore - Commodore 65 - La storia
 
Pennisi - Essere Richard Altwasser
Pennisi - Essere Richard AltwasserPennisi - Essere Richard Altwasser
Pennisi - Essere Richard Altwasser
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
Richard Süselbeck - Building your own ride share app - Codemotion Amsterdam 2019
 
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
Eward Driehuis - What we learned from 20.000 attacks - Codemotion Amsterdam 2019
 
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 - Francesco Baldassarri  - Deliver Data at Scale - Codemotion Amsterdam 2019 -
Francesco Baldassarri - Deliver Data at Scale - Codemotion Amsterdam 2019 -
 
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
Martin Förtsch, Thomas Endres - Stereoscopic Style Transfer AI - Codemotion A...
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
Angelo van der Sijpt - How well do you know your network stack? - Codemotion ...
 
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
Lars Wolff - Performance Testing for DevOps in the Cloud - Codemotion Amsterd...
 
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
Sascha Wolter - Conversational AI Demystified - Codemotion Amsterdam 2019
 
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
Michele Tonutti - Scaling is caring - Codemotion Amsterdam 2019
 
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
Pat Hermens - From 100 to 1,000+ deployments a day - Codemotion Amsterdam 2019
 
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
James Birnie - Using Many Worlds of Compute Power with Quantum - Codemotion A...
 
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
Don Goodman-Wilson - Chinese food, motor scooters, and open source developmen...
 
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
Pieter Omvlee - The story behind Sketch - Codemotion Amsterdam 2019
 
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
Dave Farley - Taking Back “Software Engineering” - Codemotion Amsterdam 2019
 
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
Joshua Hoffman - Should the CTO be Coding? - Codemotion Amsterdam 2019
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

Rafaëla Breed - Tracing performance of your service calls - Codemotion Amsterdam 2019

  • 1. { Tracing performance with some help of Sleuth, Zipkin & ELK } Rafaëla Breed Amsterdam | April 2-3, 2019
  • 2. Rafaëla Breed • So#ware engineer @ Luminis Amsterdam • Java developer • Spring(Boot) • Photography, traveling
  • 4. New company, new application
  • 5. Let’s just start developing our applica4on
  • 6. Everything works fine, but… …there comes the tester/business/client: ! “It does not work” " “So, what does not work?” # “Well, it is slow” $ “All right, do you know which step is being slow exactly?” # “When I push the toast bu>on, it takes 5 seconds to get the results. That is way too slow. We have to service our customers as fast as possible and ……” %
  • 7. Microservice Microservice Microservice MicroserviceMicroservice What do we know? Breakfast service Get toasted bread Machine service Get toaster informa/on Energy service Get power usage Temperature service Get temperature Preference service Get preference of toast Request Request Request Request Request Response Response Response Response Response
  • 8. What do we have?
  • 9. ELK: Elas)cSearch, Logstash, Kibana • Applica(ons • Collect • Parse • Transform • Store • Search • Analyze • Visualize • Explore Maven Logback GELF dependency
  • 10. Kibana Log messages of the applications Fields used in logs Filters Search
  • 11. Let’s try & dive in our logging
  • 12. Summary of demo • Easy search & filter by ELK • But… Not easy to track specific events… yet
  • 13. What we would like to have •Correlation between operations •Each starting operation => unique id •Each next operation => unique id
  • 14. What Sleuth can offer • Depicted from Dapper Infrastructure, Zipkin, Htrace • Implementable via Maven/Gradle • Brave is used as tracing library • Every first remote call starts a trace (aka uber-span) • Every following remote call starts a span (aka child span) • Traces are passed to next service(s)
  • 15. Adding Sleuth to your project • To every SpringBoot app we add: <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <ar@factId>spring-cloud-sleuth</ar@factId> <version>${spring.cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <ar@factId>spring-cloud-starter-sleuth</ar@factId> </dependency> </dependencies> • Or take a look at https://cloud.spring.io/spring- cloud-sleuth/ • Using custom log appender(s)? Add the properties X-B3-TraceId and X-B3-SpanId to your configuration!
  • 16. Trace Summary of demo Span E Parent Span A Span D Parent Span B Span C Parent Span B Span B Parent Span A Span A Request Request Request Request Request Response Response Response Response Response Breakfast service Get toasted bread Machine service Get toaster informa/on Energy service Get power usage Temperature service Get temperature Preference service Get preference of toast
  • 18. Zipkin • Developed by Twitter in 2012 • Adapted and open-sourced in 2015 as OpenZipkin • Distributed tracing system • Trace down your system(s)
  • 19. Adding Zipkin client to your project • To every SpringBoot app we add: <!-- Assuming you already added the spring cloud sleuth dependency in your dependencyManagement --> <dependency> <groupId>org.springframework.cloud</groupId> <arDfactId>spring-cloud-starter-zipkin</arDfactId> </dependency>
  • 20. Sampler for Zipkin • Do you want to put each request into Zipkin? • Up-front decision • Probability 0…1 à chance 0 to 100% • Default = ProbabilityBasedSampler 0.1 • ALWAYS_SAMPLE • Custom declaraHve sampling • Custom sampling on request • Rate-limiHng sampler • X-B3-Flags overrides (client request header)
  • 21. Getting a Zipkin server • Github project • Docker images (production ready) • Cloud solutions for AWS/Azure available Zipkin Server Collector Storage API UI
  • 22. Summary of demo • The Zipkin client sends enriched information of Sleuth to your Zipkin Server • The Zipkin Server provides a user interface in which you can overview the details of the events logged by Sleuth/Zipkin Client
  • 23. Summary of demo • The user interface with clear graphics of events with 2mes
  • 24. Overview what will happen (a bit under the hood) Spring boot applica.on Spring Cloud Sleuth Spring Cloud Zipkin Brave’s Tracing Zipkin’s Reporter Traces, span Zipkin server Sampler Zipkin’s Sender -> [KAFKA, RABBIT, WEB]
  • 25.
  • 26.
  • 27. Our Cucumber tests • TDD, business scenario’s • Logs tests & apps available
  • 31. “Über-trace” aka conversa1on Trace Microservice Trace Trace Our future wishes Request Response Microservice Breakfast service Get toasted bread + Request Microservice Response Breakfast service Get fried egg + Request Response Breakfast service Get fried bacon Trace RequestResponse Microservice Breakfast service Get coffee
  • 32. Conversa)on ID specs • Client may pass request header as X-B3-ConvID • If not passed à application creates it • Subsequent calls of services receive it & use it • Loggable & passed to Zipkin à searchable • Client response header has X-B3-ConvID
  • 33. Adding a custom tracefilter • Extend your class with GenericFilterBean • Ensure that the @Order is before or a'er TraceWebServletAutoConfigura>on.TRACING_FILTER_ORDER, dependent on what you want to provide
  • 34. Propaga'on fields • Or bagage • Addable fields passed through services with trace and every span Trace Microservice Span Microservice Span X-B3-CONVID X-B3-CONVID X-B3-CONVID
  • 35. Tags • Addable fields for specific span for details / lookup • Will be passed to Zipkin Microservice Span Zipkin server X-B3-CONVID X-B3-CONVID X-B3-CONVID
  • 36. Summary of demo • Manipulate pass through of Sleuth with a custom filter • Propaga+on fields will be passed to the whole trace • A tag is used to tag a span & is also passed to Zipkin • Make conversa<on id or trace id available in your reports!
  • 37. But… …what about applications without Spring Boot? …what about applications without Java? …are there alternatives to Zipkin?
  • 39. Summary • Easy review of application calls with ELK, Sleuth, Zipkin • More clear separation of events by traces & spans with Sleuth • More easy search for performance latencies by visualization in Zipkin • Extra information by extra custom interceptors/filters • Logging and tracing will go hand-in-hand Golden circle of observability
  • 40. Thank you for your ,me! • Ques%ons? • Please give feedback in the app • Presenta%on & code at h:ps://github.com/RDBreed/sleuthzipkindemo Observability & serverless? 14:10-14:50 by Yan Cui @ room 2