Solon

使用分布式监控服务(metrics)

</> markdown

生态 / Solon Cloud Metrics [传送]

1、情况简介

使用 micrometer(全面) 和 CloudMetricService(简单)两套接口,做分布式监控服务。使用简单的分布式监控服务(目前适配有:water)

当有 micrometer 适配插件时,也会收集 CloudMetricService 接口的数据。

2、简单示例

//监控服务的路径请求性能(后端实现的时候,可以进一步记录超5秒、超1秒的次数;以及典线图)
CloudClient.metric().addMeter("path", path, milliseconds);

//监控服务的路径请求出错次数
CloudClient.metric().addCount("path_err", path, 1);

//监控服务的运行时状态
CloudClient.metric().addGauge("service", "runtime", RuntimeStatus.now());