提交 16a4c87e 编写于 作者: Q qinyingjie

fix:添加配置

上级 0f4eb170
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
<module>springcloud-service-config-info</module> <module>springcloud-service-config-info</module>
<module>springcloud-service-feign</module> <module>springcloud-service-feign</module>
<module>springcloud-service-zuul</module> <module>springcloud-service-zuul</module>
<module>springcloud-service-zipkin</module>
<module>springcloud-service-consul</module> <module>springcloud-service-consul</module>
<module>springcloud-service-hystrix-dashboard</module> <module>springcloud-service-hystrix-dashboard</module>
<module>springcloud-service-hystrix-turbine</module> <module>springcloud-service-hystrix-turbine</module>
......
...@@ -8,6 +8,11 @@ spring: ...@@ -8,6 +8,11 @@ spring:
password: 716288qwe password: 716288qwe
application: application:
name: goods-service #服务名称 name: goods-service #服务名称
zipkin:
base-url: http://localhost:9411 #zipkin地址 默认值就是0.1,代表收集10%的请求追踪信息。
sleuth:
sampler:
percentage: 0.1 #收集百分比
#服务提供者 #服务提供者
eureka: eureka:
......
...@@ -7,7 +7,13 @@ spring: ...@@ -7,7 +7,13 @@ spring:
username: root username: root
password: 716288qwe password: 716288qwe
application: application:
name: goods-service #服务名称 name: goods-service #服务名
zipkin:
base-url: http://localhost:9411 #zipkin地址 默认值就是0.1,代表收集10%的请求追踪信息。
sleuth:
sampler:
percentage: 0.1 #收集百分比
#服务提供者 #服务提供者
eureka: eureka:
......
...@@ -8,6 +8,11 @@ spring: ...@@ -8,6 +8,11 @@ spring:
password: 716288qwe password: 716288qwe
application: application:
name: goods-service #服务名称 name: goods-service #服务名称
zipkin:
base-url: http://localhost:9411 #zipkin地址 默认值就是0.1,代表收集10%的请求追踪信息。
sleuth:
sampler:
percentage: 0.1 #收集百分比
#服务提供者 #服务提供者
eureka: eureka:
......
spring: spring:
application: application:
name: portal-service #服务名称 name: portal-service #服务名称
zipkin:
#服务提供者 base-url: http://localhost:9411 #zipkin地址 默认值就是0.1,代表收集10%的请求追踪信息。
sleuth:
sampler:
percentage: 0.1 #收集百分比
eureka: eureka:
client: client:
service-url: service-url:
......
spring: spring:
application: application:
name: portal-service #服务名称 name: portal-service #服务名称
zipkin:
base-url: http://localhost:9411 #zipkin地址 默认值就是0.1,代表收集10%的请求追踪信息。
sleuth:
sampler:
percentage: 0.1 #收集百分比
#服务提供者 #服务提供者
eureka: eureka:
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.kwan.springcloud</groupId>
<artifactId>springcloud-service-parent</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>springcloud-service-zipkin</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springcloud-service-zipkin</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
<version>2.10.4</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<version>2.10.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.kwan.springcloud;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import zipkin2.server.internal.EnableZipkinServer;
/**
* http:/localhost:9411/zipkin
*
* @author : qinyingjie
* @version : 2.2.0
* @date : 2023/1/16 10:02
*/
@EnableZipkinServer
@SpringBootApplication
public class ZipkinApplication {
public static void main(String[] args) {
SpringApplication.run(ZipkinApplication.class, args);
}
}
#端口号
server:
port: 9411
#spring 相关配置
spring:
application:
name: zipkin-service
#注册中心
eureka:
client:
service-url:
defaultZone: http://eureka8767:8767/eureka/,http://eureka8768:8768/eureka/,http://eureka8769:8769/eureka/
package com.kwan.springcloud;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ZipkinApplicationTests {
@Test
void contextLoads() {
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册