houdq / blog

java 学习笔记
0 stars 0 forks source link

springcloud-sleuth #103

Open houdq opened 11 months ago

houdq commented 11 months ago

官网-overview

Notice that the application name is inside the brackets at the beginning. These brackets are added by Sleuth. They represent the application name, trace ID, and span ID. 请注意,应用程序名称位于开头的括号内。这些括号是 Sleuth 添加的。它们代表应用程序名称、跟踪 ID 和跨度 ID。

生成规则

[server-name,trace Id,span Id] 
2023-11-20 18:54:24.894  INFO [demo-user,655b3ae0d7327932f8f33d38beaf860f,1141bc0a0348b61f] 58442 --- [nio-8082-exec-1] cn.ddx.demo.user.UserController          : 8082
houdq commented 11 months ago

maven 依赖

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${release.train.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-sleuth</artifactId>
    </dependency>
</dependencies>