当前位置: 首页 > news >正文

Grafana监控可视化

Grafana

Grafana是一款用开源数据可视化工具,可以做数据监控和数据统计,用于监控的可视化,带有告警功能。

Grafana 配置Dashboards(仪表板)

可以使用 Prometheus 监控, 在Grafana的仪表板上进行可视化。

详情见: https://blog.csdn.net/Hu_wen/article/details/136940949

Dashboards(仪表板)示例:

在这里插入图片描述

查看Dashboards(仪表板)配置:

左上角的 DataSource 是数据源, Application 是应用名称。
在这里插入图片描述

Dashboards(仪表板)变量:

在这里插入图片描述

Dashboards(仪表板)配置:

在这里插入图片描述

仪表板配置的 Json Model

可以使用 仪表板配置的 Json Model , 进行仪表板配置的 导入,直接生成对应的仪表板。

{"annotations": {"list": [{"builtIn": 1,"datasource": {"type": "grafana","uid": "-- Grafana --"},"enable": true,"hide": true,"iconColor": "rgba(0, 211, 255, 1)","name": "Annotations & Alerts","target": {"limit": 100,"matchAny": false,"tags": [],"type": "dashboard"},"type": "dashboard"}]},"editable": true,"fiscalYearStartMonth": 0,"graphTooltip": 0,"id": 10027,"links": [],"liveNow": false,"panels": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "continuous-BlPu"},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "red","value": 80}]},"unit": "none"},"overrides": []},"gridPos": {"h": 5,"w": 10,"x": 0,"y": 0},"id": 11,"options": {"colorMode": "background","graphMode": "none","justifyMode": "auto","orientation": "horizontal","reduceOptions": {"calcs": ["lastNotNull"],"fields": "","values": false},"textMode": "value_and_name"},"pluginVersion": "9.3.2","targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "sum(http_server_requests_seconds_count)","legendFormat": "总请求次数","range": true,"refId": "A"}],"type": "stat"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "thresholds"},"custom": {"align": "auto","displayMode": "auto","filterable": false,"inspect": false,"minWidth": 50},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "#EAB839","value": 10},{"color": "red","value": 80}]}},"overrides": [{"matcher": {"id": "byName","options": "Value"},"properties": [{"id": "custom.displayMode","value": "color-background"},{"id": "displayName","value": "发生次数"}]}]},"gridPos": {"h": 10,"w": 14,"x": 10,"y": 0},"id": 9,"options": {"footer": {"enablePagination": false,"fields": [],"reducer": ["sum"],"show": true},"showHeader": true,"sortBy": [{"desc": true,"displayName": "发生次数"}]},"pluginVersion": "9.3.2","targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","exemplar": false,"expr": "sum(http_server_requests_seconds_count{outcome!=\"SUCCESS\"}) by (app, application, uri, status)","format": "table","instant": true,"legendFormat": "{{app}}{{application}} - {{uri}} - {{status}}","range": false,"refId": "A"}],"title": "异常请求次数","transformations": [{"id": "filterFieldsByName","options": {"include": {"names": ["app","status","uri","application","Value"]}}}],"type": "table"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "red","value": 80}]},"unit": "ms"},"overrides": []},"gridPos": {"h": 5,"w": 5,"x": 0,"y": 5},"id": 12,"options": {"colorMode": "background","graphMode": "area","justifyMode": "auto","orientation": "horizontal","reduceOptions": {"calcs": ["lastNotNull"],"fields": "","values": false},"textMode": "value_and_name"},"pluginVersion": "9.3.2","targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "sum(http_server_requests_seconds_sum{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"}) / sum(http_server_requests_seconds_count{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"})","legendFormat": "总平均响应时间","range": true,"refId": "A"}],"type": "stat"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "red","value": 80}]},"unit": "reqps"},"overrides": []},"gridPos": {"h": 5,"w": 5,"x": 5,"y": 5},"id": 13,"options": {"colorMode": "background","graphMode": "area","justifyMode": "auto","orientation": "horizontal","reduceOptions": {"calcs": ["lastNotNull"],"fields": "","values": false},"textMode": "value_and_name"},"pluginVersion": "9.3.2","targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "sum(rate(http_server_requests_seconds_count))","legendFormat": "当前并发数","range": true,"refId": "A"}],"type": "stat"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "thresholds"},"custom": {"align": "auto","displayMode": "auto","inspect": false},"mappings": [],"noValue": "0","thresholds": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "red","value": 80}]},"unit": "none"},"overrides": [{"matcher": {"id": "byName","options": "method_name"},"properties": [{"id": "custom.width","value": 640}]},{"matcher": {"id": "byName","options": "最大值"},"properties": [{"id": "unit","value": "ms"},{"id": "thresholds","value": {"mode": "absolute","steps": [{"color": "green","value": null},{"color": "#EAB839","value": 50},{"color": "red","value": 80}]}},{"id": "custom.displayMode","value": "color-background"}]}]},"gridPos": {"h": 13,"w": 24,"x": 0,"y": 10},"id": 5,"options": {"footer": {"enablePagination": false,"fields": "","reducer": ["sum"],"show": false},"showHeader": true,"sortBy": [{"desc": true,"displayName": "最大值"}]},"pluginVersion": "9.3.2","targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","exemplar": false,"expr": "dubbo_method_tp90","format": "time_series","instant": false,"legendFormat": "__auto","range": true,"refId": "A"}],"title": "Panel Title","transformations": [{"disabled": true,"id": "labelsToFields","options": {"keepLabels": ["host","namespace","pod"],"mode": "rows"}},{"id": "reduce","options": {"includeTimeField": false,"labelsToFields": true,"mode": "seriesToRows","reducers": ["last"]}},{"id": "organize","options": {"excludeByName": {"Field": true,"__name__": true,"env": true,"instance": true,"job": true,"namespace": false,"node": true,"pod_template_hash": true},"indexByName": {"Field": 0,"Last": 16,"__name__": 1,"app": 4,"application": 15,"buildVersion": 5,"env": 6,"group": 8,"host": 9,"instance": 10,"job": 11,"method_name": 12,"namespace": 7,"node": 2,"pod": 3,"pod_template_hash": 13,"region": 14},"renameByName": {"Last": "最大值","application": "","job": "","method_name": "方法名","namespace": ""}}}],"type": "table"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "palette-classic"},"custom": {"axisCenteredZero": false,"axisColorMode": "text","axisLabel": "","axisPlacement": "auto","barAlignment": 0,"drawStyle": "line","fillOpacity": 0,"gradientMode": "none","hideFrom": {"legend": false,"tooltip": false,"viz": false},"lineInterpolation": "linear","lineWidth": 1,"pointSize": 5,"scaleDistribution": {"type": "linear"},"showPoints": "auto","spanNulls": false,"stacking": {"group": "A","mode": "none"},"thresholdsStyle": {"mode": "off"}},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green"},{"color": "red","value": 80}]},"unit": "reqps"},"overrides": []},"gridPos": {"h": 12,"w": 24,"x": 0,"y": 23},"id": 2,"options": {"legend": {"calcs": ["max"],"displayMode": "table","placement": "right","showLegend": true,"sortBy": "Max","sortDesc": true},"tooltip": {"mode": "single","sort": "none"}},"targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "rate(http_server_requests_seconds_count{outcome!=\"SUCCESS\"})","legendFormat": "{{application}}{{app}} - {{uri}}","range": true,"refId": "A"}],"title": "接口平均响应时间","type": "timeseries"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "palette-classic"},"custom": {"axisCenteredZero": false,"axisColorMode": "text","axisLabel": "","axisPlacement": "auto","barAlignment": 0,"drawStyle": "line","fillOpacity": 0,"gradientMode": "none","hideFrom": {"legend": false,"tooltip": false,"viz": false},"lineInterpolation": "linear","lineWidth": 1,"pointSize": 5,"scaleDistribution": {"type": "linear"},"showPoints": "auto","spanNulls": false,"stacking": {"group": "A","mode": "none"},"thresholdsStyle": {"mode": "off"}},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green"},{"color": "red","value": 80}]},"unit": "ms"},"overrides": []},"gridPos": {"h": 12,"w": 24,"x": 0,"y": 35},"id": 7,"options": {"legend": {"calcs": ["max"],"displayMode": "table","placement": "right","showLegend": true,"sortBy": "Max","sortDesc": true},"tooltip": {"mode": "single","sort": "none"}},"targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "sum by (app, application, uri) (http_server_requests_seconds_sum{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"}) / sum by (app, application, uri) (http_server_requests_seconds_count{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"})","legendFormat": "{{application}}{{app}} - {{uri}}","range": true,"refId": "A"}],"title": "接口平均响应时间","type": "timeseries"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "palette-classic"},"custom": {"axisCenteredZero": false,"axisColorMode": "text","axisLabel": "","axisPlacement": "auto","barAlignment": 0,"drawStyle": "line","fillOpacity": 0,"gradientMode": "none","hideFrom": {"legend": false,"tooltip": false,"viz": false},"lineInterpolation": "linear","lineWidth": 1,"pointSize": 5,"scaleDistribution": {"type": "linear"},"showPoints": "auto","spanNulls": false,"stacking": {"group": "A","mode": "none"},"thresholdsStyle": {"mode": "off"}},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green"},{"color": "red","value": 80}]},"unit": "ms"},"overrides": []},"gridPos": {"h": 12,"w": 24,"x": 0,"y": 47},"id": 3,"options": {"legend": {"calcs": ["max"],"displayMode": "table","placement": "right","showLegend": true,"sortBy": "Max","sortDesc": true},"tooltip": {"mode": "single","sort": "none"}},"targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "max by (app, application, uri) (http_server_requests_seconds_max{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"})","legendFormat": "{{application}}{{app}} - {{uri}}","range": true,"refId": "A"}],"title": "接口最大响应时间","type": "timeseries"},{"datasource": {"type": "prometheus","uid": "${datasource}"},"fieldConfig": {"defaults": {"color": {"mode": "palette-classic"},"custom": {"axisCenteredZero": false,"axisColorMode": "text","axisLabel": "","axisPlacement": "auto","barAlignment": 0,"drawStyle": "line","fillOpacity": 0,"gradientMode": "none","hideFrom": {"legend": false,"tooltip": false,"viz": false},"lineInterpolation": "linear","lineWidth": 1,"pointSize": 5,"scaleDistribution": {"type": "linear"},"showPoints": "auto","spanNulls": false,"stacking": {"group": "A","mode": "none"},"thresholdsStyle": {"mode": "off"}},"mappings": [],"thresholds": {"mode": "absolute","steps": [{"color": "green"},{"color": "red","value": 80}]},"unit": "none"},"overrides": []},"gridPos": {"h": 12,"w": 24,"x": 0,"y": 59},"id": 6,"options": {"legend": {"calcs": ["mean","max","last"],"displayMode": "table","placement": "right","showLegend": true},"tooltip": {"mode": "single","sort": "none"}},"targets": [{"datasource": {"type": "prometheus","uid": "${datasource}"},"editorMode": "code","expr": "sum by (app, application, uri) (rate(http_server_requests_seconds_count{app!='xxl-job-admin', uri!~\"/getHealth|/metrics\"}[1m]))","legendFormat": "{{application}}{{app}} - {{uri}}","range": true,"refId": "A"}],"title": "接口每秒并发数","type": "timeseries"}],"schemaVersion": 37,"style": "dark","tags": [],"templating": {"list": [{"current": {"selected": true,"text": "Victoriametrics-cntest","value": "Victoriametrics-cntest"},"hide": 0,"includeAll": false,"label": "DataSource","multi": false,"name": "datasource","options": [],"query": "prometheus","queryValue": "","refresh": 1,"regex": "","skipUrlSync": false,"type": "datasource"}]},"time": {"from": "now-24h","to": "now"},"timepicker": {},"timezone": "","title": "业务指标","uid": "A79GypqHz","version": 5,"weekStart": ""
}
http://www.dtcms.com/a/520308.html

相关文章:

  • GEO数据分析与效果归因:GEO 效果的多维度分析框架
  • 31.stream数据类型应用
  • 蓝牙协议6.1
  • 微服务中的服务熔断、降级与限流
  • 查网站的建站系统百度搜索网站图片
  • 网站界面风格设计描述网站类网站开发犯罪吗
  • 新站点seo联系方式设计工作室网站首页
  • Adobe Lightroom Classic 2025解锁版 (专业照片管理)
  • univla复现libero
  • kubernets的pod管理
  • 14、【Ubuntu】【VSCode】VSCode 断联问题分析:hostname(二)
  • Java 堆排序(Heap Sort)详解教程
  • 软件设计师知识点总结:操作系统
  • 黄岩路桥网站设计网站流量提升方案
  • 设计师网站欣赏店铺只做商品展示网站怎么做
  • dify部署及SSL自签实现
  • 云南省建设厅标准员网站手机兼职赚钱
  • Redis哈希表渐进式rehash深度解析:为何百万数据迁移不阻塞服务?
  • 广东省省考备考(第一百三十一天10.23)——科学推理:电学(第六节课)
  • Spring的三级缓存和SpringMVC的流程
  • 为什么麒麟信创系统需要开启overcommit_memory才能安装postgresql成功
  • PostGresql All语法
  • [java] 图文示八股
  • 【图像处理】图像形态学操作
  • 网站上传 空间 数据库开发一个电商平台app要多少钱
  • 如何制作网站链接数字镭网站开发
  • 使用python的matplotlib进行绘图
  • Nginx使用auth_request模块做外部认证集成Kibana
  • 【题解】洛谷 P2218 [HAOI2007] 覆盖问题 [二分 + 思维]
  • xss-labs pass-12