prometheus集成grafana实现可视化
所属分类 prometheus
浏览量 1505
https://prometheus.io/docs/visualization/grafana/
Grafana supports querying Prometheus.
The Grafana data source for Prometheus is included since Grafana 2.5.0 (2015-10-28).
下载 解压 启动 grafana
wget https://dl.grafana.com/oss/release/grafana-6.1.3.linux-amd64.tar.gz
tar -zxvf grafana-6.1.3.linux-amd64.tar.gz
./bin/grafana-server web
By default, Grafana will be listening on http://localhost:3000. The default login is "admin" / "admin".
配置文件
conf/grafana.ini
http_port = 3000
# Default UI theme ("dark" or "light")
default_theme = dark
https://grafana.com/docs/guides/getting_started/
创建 Prometheus 数据源
数据源类型 Prometheus
Prometheus server URL
http://localhost:9090/
创建图表
title
Prometheus data source
Prometheus query
legend 图例 {{method}} - {{status}}
Importing pre-built dashboards
a collection of shared dashboards
导入 json 格式
修改数据源
https://grafana.com/dashboards
Node Exporter Full
https://grafana.com/dashboards/1860
BBj JVM Overviewby
Dashboard for JVM metrics with Prometheus / JMX Exporter
https://grafana.com/dashboards/5543
也可以创建自己的 dashboard
add panel 添加面板
一个 dashboard 包含多个 面板
常用监控图表配置
各节点tps
rate(invoke_count{job=~"$job"}[1m])
总的tps
sum(rate(invoke_count{job=~"$job"}[1m]))
平均响应时间
rate(invoke_total_time{instance=~"$instance",job=~"$job"}[1m]) / rate(invoke_count{instance=~"$instance",job=~"$job"}[1m])
上一篇
下一篇
linux下找出占用指定端口的进程
jvm设置滚动记录GC日志
基于数据库的分布式锁设计
g1 GC 要点
四种引用及WeakHashMap介绍
软引用弱引用及引用队列实战例子