An introduction to the distributed tracing pattern





When it comes to health and monitoring, a distributed architecture can give you a couple of problems. You can deal with dozens, if not hundreds of microservices, each of which may have been created by different development teams.





, , . , AWS, Google Cloud, Azure, , - ( , , IP- . .).









:

  • - , /, . .





  • () -





  • () -









: ( ) .





, , . , , . :





Splunk





Datadog





Logstash





Fluentd





, . INFO- .





, . , , , , , - - (id).





userId, , - UUID, . ( , ). requestId userId , , !!!





Figure 1. Centralized logging.
1. .





, (tag) Java (RequestFilter).





Figure 2: Log4J2 configuration and sample log
2: Log4J2





Figure 3: Query Filters by UUID or UserId
3: UUID UserId





- , . , ​​:





  1. .





  2. / (, ).





, (- - ).





Figure 4. Trace
4.





DataDog. , .





. /, . , . ( , / ).





. , , .





userId (, UUID) / . , !!





:





  1. .





  2. .





  3. , .





#1: , DATADOG





: DataDog APM





DataDog APM (application performance monitors - ). Datadog 100%- , , .





Datadog . Datadog . , , DD traceId , .





Figure 6: Instrumentation of the Application with DataDog
6: DataDog





Figure 7: Correlation of Logs and Traces in DataDog
7: DataDog





#2: ZIPKINS, CLOUD-SLEUTH SPRING BOOT





:





Zipkins, Cloud Sleuth





:





  1. SPRING boot









  2. Zipkins.





  3. OpenTracing .





  4. Log4j2 MDC.





:





  1. , . ElasticSearch , , cloud-sleuth ( X-B3-TraceId).





:





Figure 8: Zipkins, Cloud Sleuth and Spring Boot.
8: Zipkins, Cloud Sleuth Spring Boot.





#3: AMAZON XRAY





: AmazonXRAY





:





  1. AWS, , AWS





  2. AWS (REQUEST ID) , . (: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-request-tracing.html)





  3. API , AWS.





  4. CLOUDWATCH logs





:





  1. Cloudwatch log





#4: JAGER





: Jager





:





  1. opentracing





  2. , Spring





  3. Jager Agent, .





:





.





. , , . , . :-)






" ". .













All Articles