操作场景
该任务指导您使用服务监控功能。
前提条件
操作步骤
注意
Finchley 版本 SDK 相关设置
1. 向工程中添加依赖。在
pom.xml
中添加以下代码,依赖的是 spring-cloud-tsf-sleuth
而不是 spring-cloud-tsf-monitor
。<dependency><groupId>com.tencent.tsf</groupId><artifactId>spring-cloud-tsf-sleuth</artifactId><version><!-- 调整为 SDK 最新版本号 --></version></dependency>
2. 向 Application 类中添加注解
@EnableTsfMonitor
:// 下面省略了无关的代码import com.tencent.tsf.monitor.annotation.EnableTsfMonitor;@SpringBootApplication@EnableTsfMonitorpublic class ProviderApplication {public static void main(String[] args) {SpringApplication.run(ProviderApplication.class, args);}}