spring cloud seata 服务监控
metrics设计:https://seata.io/zh-cn/docs/dev/seata-mertics.html
metrics配置:https://seata.io/zh-cn/docs/ops/operation.html
**************************
seata
metrics 相关配置
metrics.enabled=true #开启metrics
metrics.registryType=compact
metrics.exporterList=prometheus
metrics.exporterPrometheus-port=9898 #metrics端口默认为9898
**************************
prometheus:收集展示metrics信息
下载镜像
docker pull prom/prometheus
配置文件:prometheus.yml
global:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['192.168.57.4:9090']
labels:
instance: prometheus
hello: gtlx
- job_name: 'seata'
static_configs:
- targets: ['192.168.57.22:9898']
labels:
instance: seata
hello: 瓜田李下
创建容器
docker run -it -d --net fixed3 --ip 192.168.57.4 \
-v /usr/prom/prometheus.yml:/etc/prometheus/prometheus.yml \
--name prometheus prom/prometheus
**************************
grafana:视图化显示数据
下载镜像
docker pull prom/grafana
创建容器
docker run -it -d --net fixed3 --ip 192.168.57.5 --name grafana grafana/grafana
**************************
使用测试
192.168.57.22:9898/metrics
192.168.57.4:9090/graph,选择seata_transaction
************************
192.168.57.5:3000
用户名:admin,密码:admin
配置数据源:http://192.168.57.4:9090,name:prom,type:prometheus,
新建面板,查询数据源:prom,metrics:seata_transaction