Dubbo 支持采集运行态 Metrics 指标并接入 Prometheus、Grafana 系统,实现对微服务集群的可视化监控,以下是一个具体的使用示例,可查看 示例完整源码。
test server work as expected:
install prometheus and open prometheus config file prometheus.yml
, write the config like this
install grafana and open grafana web page like localhost:3000
open: 【Home / Connections / Data sources】
click 【Add new data source】
select Prometheus
enter 【Prometheus server URL】 like http://localhost:9090
and click 【Save & test】
open 【Home / Dashboards 】click 【New】【import】and enter 19294 click Load
if your grafana can’t access internet you can open https://grafana.com/grafana/dashboards/19294-dubbo-observability/
and click 【Download JSON】
paste the JSON
click 【Import】button and you will see the Dubbo Observability dashboard,enjoy it
install prometheus in k8s kube-prometheus
Set prometheus-service.yaml
type to NodePort
dubboPodMoitor.yaml
to kube-prometheus
manifests
dir, The content is as followskubectl apply -f Deployment.yaml