1. dubbo Monitor
目前不维护了, 建议使用 dubbo admin
2. dubbo admin
Dubbo 原生的admin 工程并不好用,,功能并不全
安装使用参考
https://blog.csdn.net/qq_28988969/article/details/79866111
否则使用 最新版的 可能安装使用的时候 ,爆了404 ,同时git上面的说明 文档也不太正确。
3. 链路监控
Instrumented client 就是 客户端, 调用的时候会把一些数据放入到 Transport 里面。
Instrumented server 服务端,调用的时候也会把调用数据放入到 Transport 里面。
Transport 放入 collection 里面 进行 收集存储
而 Transport 可以使用 brave
去下载 zipkin 服务器项目: zipkin.jar ,它是一个springboot 工作, 可以直接启动,
启动之后 http://localhost:9411 就可以 看到 zipkin 的 管理页面了。
dubbo 集成
依赖
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
<version>5.5.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-reporter-bom</artifactId>
<version>2.7.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-instrumentation-dubbo-rpc</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-spring-beans</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-context-slf4j</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
<artifactId>zipkin-sender-okhttp3</artifactId>
</dependency>
<dependency>
<groupId>org.apache.curator</groupId>
<artifactId>curator-framework</artifactId>
<version>4.0.1</version>
</dependency>
之后 只需要在 dubbo 的 服务或者接口的 dubbo 注解里面加上 过滤器 配置即可
filter = "tracing"
@Service(interfaceClass = OrderServiceAPI.class,group = "order2018",filter = "tracing")
或者
@Reference(interfaceClass = CinemaServiceAPI.class,check = false,filter = "tracing")
private CinemaServiceAPI cinemaServiceAPI;
运行 dubbo 服务调用的时候,就可以在 zipkin 管理页面看到 调用链信息了
zipkin 的监控数据可以放入 数据库里面存储,如果 存储mysql 里面,
是要自建 三张表的: zipkin_spans , zipkin_annotations , zipkin_dependencies