Welcome to my GitHub
https://github.com/zq2599/blog_demos
Content: Classification and summary of all original articles and supporting source code, involving Java, Docker, Kubernetes, DevOPS, etc.;
About Jaeger development series (java version)
- This article belongs to the "Jaeger Development Series", which is the first one. This series is Xinchen's original. It aims to master Jaeger-related technologies with Java programmers through actual combat exercises and make them play a huge role in distributed systems;
- The whole series will be involved from shallow to deep, from basic functions to deep customization. I hope this series can grow with you and provide you with some timely references;
Overview of this article
- As the beginning of the "Jaeger Development Series", we first spend one minute to understand the basic concepts of Jaeger, then 30 seconds to complete the deployment, and then 30 seconds to experience the basic functions, and start the Java programmer's Jaeger with the most relaxed posture and mood. journey of;
- The following is the environment and software I used to execute this actual combat here:
- Computer: MacBook Pro, macOS Big Sur (11.5.2)-you can also use Linux, such as Ubuntu or CentOS
- Docker:20.10.7
- JDK:8u301
- Let’s start with the basic concepts of Jaeger;
About Jaeger
- Jaeger is an open source distributed call chain tracking solution, created by Uber, and later donated to CNCF (Cloud Native Computing Foundation), official website address: https://www.jaegertracing.io/
- Jaeger's backend, web, local library, etc. all comply with OpenTracing standard
- In the OpenTracing standard, a logical unit of work is called <font color="blue">span</font>, which has its own name, start time, duration, label and other characteristics, as shown in the figure below:
- The following is the official Jaeger architecture diagram (this is the version that does not use Kafka for buffering). The top line indicates the language type supported by Jaeger. It can be seen that after the application uses the SDK, the business span is sent to the jaeger-agent (via UDP Protocol), and then pushed to jaeger-collector, and the data is written into the database (DB) by jaeger-collector. In this way, the user can see the detailed call chain tracking results when accessing jaeger-query through a browser. In addition, the red dotted line Is the control signal (such as sampling-related parameters):
About this experience
- Today’s experience environment consists of the following content. There is a web application named <font color="blue">jaeger-service-provider</font>. When its web interface is accessed, it will operate redis, and then will The service data is reported to Jaeger, and then we can see the details of this service on Jaeger:
Rapid deployment of jaeger experience environment
- Please make sure your docker-compose function can be used normally
- Create a file <font color="blue">docker-compose.yml</font> with the following content:
version: '3.0'
networks:
jaeger-tutorials-net:
driver: bridge
ipam:
config:
- subnet: 192.168.1.0/24
gateway: 192.168.1.1
services:
jaeger:
image: jaegertracing/all-in-one:1.26
container_name: jaeger
#选择网络
networks:
- jaeger-tutorials-net
#选择端口
ports:
- 16686:16686/tcp
restart: always
redis:
image: redis:6.2.5
container_name: redis
#选择网络
networks:
- jaeger-tutorials-net
restart: always
jaeger-service-provider:
image: bolingcavalry/jaeger-service-provider:0.0.1
container_name: jaeger-service-provider
#选择端口
ports:
- 8088:8080/tcp
#选择网络
networks:
- jaeger-tutorials-net
restart: always
- Execute the command <font color="blue">docker-compose up -d</font> in the directory where docker-compose.yml is located, it will immediately start downloading three images, and then start the service:
Creating network "jaeger-service-provider_jaeger-tutorials-net" with driver "bridge"
Creating jaeger ... done
Creating jaeger-service-provider ... done
Creating redis ... done
- So far, the jaeger experience environment has been deployed, let’s experience it
Experience the jaeger function
- Use a browser to visit: <font color="blue"> http://localhost:16686/search </font>, the Jaeger page that greets you is as follows, students who are familiar with golang know what the icon means (for Xin For a Java fan like Chen, I want to see a cup of hot coffee there...):
- From the previous architecture diagram, we know that <font color="blue">jaeger-query</font> is the server service of the current page, and it also reports its usage status through Jaeger, as shown in the following figure, finally see To trace and span:
- Next, you can call the service we deployed. The browser visits: http://localhost:8088/hello , under normal circumstances, the returned timestamp is received:
- Then refresh the Jaeger page, as shown in the figure below, our service and trace names are all listed. It seems that the reported data has taken effect. Click the dot in the red box in the upper right corner of the figure below:
- After clicking the red dot, enter the details page of the corresponding trace, as shown in the figure below:
- At this point, we have completed the introductory knowledge learning and actual experience of Jaeger. If you are interested in the internal implementation details, please look forward to the next development and actual secrets. Xinchen originality will not disappoint you.
Environmental information
- Finally, attach the environment and version information required by the "Jaeger Development Series", this version can run normally, for your reference:
- Computer: MacBook Pro, macOS Big Sur (11.5.2)
- Docker:20.10.7
- JDK:8u301
- Jaeger:1.26
- opentracing-spring-jaeger-cloud-starter:3.3.1
- Spring Boot:2.4.2
- Spring Cloud:2020.0.1
- Redis:6.2.5
You are not lonely, Xinchen original is with you all the way
- Java series
- Spring series
- Docker series
- kubernetes series
- database + middleware series
- DevOps series
Welcome to pay attention to the public account: programmer Xin Chen
Search "Programmer Xin Chen" on WeChat, I am Xin Chen, and I look forward to traveling the Java world with you...
https://github.com/zq2599/blog_demos
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。