Granafa监控仪表盘:自定义简约型-只显示资源总览,各个主机详情

article/2025/9/29 7:24:40

目录

前言

Grafana选择监控仪表盘

自定义简约型-只显示资源总览,各个主机详情

监控仪表盘JSON数据


前言

相关参考:Windows监控:基于Prometheus+Grafana监控CPU、内存、磁盘、网络、GPU信息

Grafana选择监控仪表盘

访问地址:https://grafana.com/dashboards  ---  serch框输入windows  ----  选择心仪模板 (注意模板所支持的数据源为prometheus)  -----   进行 ID 或者JOSN文件两种方式导入。

自定义简约型-只显示资源总览,各个主机详情

监控仪表盘JSON数据

{"annotations": {"list": [{"builtIn": 1,"datasource": "-- Grafana --","enable": true,"hide": true,"iconColor": "rgba(0, 211, 255, 1)","name": "Annotations & Alerts","type": "dashboard"}]},"description": "Windows的Prometheus监控看板展示,增加了资源汇总展示,优化了明细展示。更新支持windows_exporter 0.13.0。","editable": true,"gnetId": 10467,"graphTooltip": 1,"id": 1,"iteration": 1605338442536,"links": [{"asDropdown": true,"icon": "external link","tags": [],"targetBlank": true,"type": "dashboards"}],"panels": [{"collapsed": false,"datasource": "Prometheus","gridPos": {"h": 1,"w": 24,"x": 0,"y": 0},"id": 41,"panels": [],"title": "资源监控","type": "row"},{"columns": [],"datasource": "Prometheus","fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fontSize": "90%","gridPos": {"h": 6,"w": 24,"x": 0,"y": 1},"id": 45,"pageSize": null,"showHeader": true,"sort": {"col": 0,"desc": true},"styles": [{"alias": "操作系统","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "product","preserveFormat": false,"sanitize": false,"thresholds": [],"type": "string","unit": "short","valueMaps": []},{"alias": "主机名称","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"link": false,"linkTooltip": "","linkUrl": "","mappingType": 1,"pattern": "hostname","preserveFormat": false,"thresholds": [],"type": "string","unit": "short"},{"alias": "主机信息","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"link": false,"linkTargetBlank": false,"linkTooltip": "${__cell_4}","linkUrl": "/d/Kdh0OoSGz/?var-job=${__cell_5}&var-hostname=All&var-instance=${__cell_4}","mappingType": 1,"pattern": "instance","thresholds": [],"type": "string","unit": "short"},{"alias": "CPU核数","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"link": false,"mappingType": 1,"pattern": "Value #B","thresholds": [],"type": "string","unit": "short"},{"alias": "总内存","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": null,"mappingType": 1,"pattern": "Value #C","thresholds": [],"type": "number","unit": "bytes"},{"alias": "运行时间","align": "auto","colorMode": "cell","colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": null,"mappingType": 1,"pattern": "Value #D","thresholds": ["259200","432000"],"type": "number","unit": "s"},{"alias": "C盘使用率","align": "auto","colorMode": "cell","colors": ["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "Value #E","thresholds": ["60","80"],"type": "number","unit": "percentunit"},{"alias": "进程数","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"link": false,"mappingType": 1,"pattern": "Value #G","thresholds": [],"type": "string","unit": "short"},{"alias": "运行服务","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "Value #H","thresholds": [],"type": "string","unit": "short"},{"alias": "CPU使用率","align": "auto","colorMode": "cell","colors": ["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "Value #I","thresholds": ["50","70"],"type": "number","unit": "percent"},{"alias": "内存使用率","align": "auto","colorMode": "cell","colors": ["rgba(50, 172, 45, 0.97)","rgba(237, 129, 40, 0.89)","rgba(245, 54, 54, 0.9)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "Value #J","thresholds": ["60","80"],"type": "number","unit": "percent"},{"alias": "CPU频率","align": "auto","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat": "YYYY-MM-DD HH:mm:ss","decimals": 2,"mappingType": 1,"pattern": "Value #K","thresholds": [],"type": "number","unit": "rothz"},{"alias": "","align": "right","colorMode": null,"colors": ["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals": 2,"pattern": "/.*/","thresholds": [],"type": "hidden","unit": "short"}],"targets": [{"expr": "windows_os_info * on(instance) group_right(product) windows_cs_hostname","format": "table","instant": true,"interval": "","legendFormat": "主机名","refId": "A"},{"expr": "time() - windows_system_system_up_time","format": "table","instant": true,"interval": "","legendFormat": "运行时间","refId": "D"},{"expr": "windows_cs_logical_processors - 0","format": "table","instant": true,"interval": "","legendFormat": "","refId": "B"},{"expr": "avg by (instance) (windows_cpu_core_frequency_mhz)","format": "table","instant": true,"interval": "","legendFormat": "","refId": "K"},{"expr": "100 - (avg by (instance) (irate(windows_cpu_time_total{mode=\"idle\"}[2m])) * 100)","format": "table","instant": true,"interval": "","legendFormat": "CPU使用率","refId": "I"},{"expr": "windows_cs_physical_memory_bytes - 0","format": "table","instant": true,"interval": "","legendFormat": "总内存","refId": "C"},{"expr": "100 - 100 * windows_os_physical_memory_free_bytes / windows_cs_physical_memory_bytes","format": "table","instant": true,"interval": "","legendFormat": "内存使用率","refId": "J"},{"expr": "1 - (windows_logical_disk_free_bytes{volume=~\"C:\"}/windows_logical_disk_size_bytes{volume=~\"C:\"})","format": "table","instant": true,"interval": "","legendFormat": "c盘使用率","refId": "E"},{"expr": "windows_os_processes","format": "table","instant": true,"interval": "","legendFormat": "进程数","refId": "G"},{"expr": "sum by (instance) (windows_service_state{state=~\"running\"})","format": "table","instant": true,"interval": "","legendFormat": "运行服务","refId": "H"}],"timeFrom": null,"timeShift": null,"title": "服务器资源总览","transform": "table","type": "table-old"},{"aliasColors": {},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","decimals": 1,"fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 1,"fillGradient": 0,"gridPos": {"h": 6,"w": 8,"x": 0,"y": 7},"hiddenSeries": false,"id": 47,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "current","sortDesc": false,"total": false,"values": true},"lines": true,"linewidth": 1,"links": [],"nullPointMode": "null","paceLength": 10,"percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"expr": "100 - (avg by (instance) (irate(windows_cpu_time_total{mode=\"idle\"}[2m])) * 100)","hide": false,"interval": "","intervalFactor": 1,"legendFormat": "{{instance}}","refId": "B"}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机CPU使用率","tooltip": {"shared": true,"sort": 2,"value_type": "cumulative"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "percent","label": null,"logBase": 1,"max": null,"min": "0","show": true},{"format": "short","label": null,"logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}},{"aliasColors": {},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","decimals": 1,"fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 1,"fillGradient": 0,"gridPos": {"h": 6,"w": 8,"x": 8,"y": 7},"hiddenSeries": false,"id": 56,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "current","sortDesc": false,"total": false,"values": true},"lines": true,"linewidth": 1,"links": [],"nullPointMode": "null","paceLength": 10,"percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"expr": "utilization_gpu","hide": false,"interval": "","intervalFactor": 1,"legendFormat": "{{instance}}_GPU","refId": "B"}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机GPU使用率","tooltip": {"shared": true,"sort": 2,"value_type": "cumulative"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "percent","label": null,"logBase": 1,"max": null,"min": "0","show": true},{"format": "short","label": null,"logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}},{"aliasColors": {"Free Physical memory": "semi-dark-green","Free physical memory": "semi-dark-green","Free virtual memory": "super-light-blue","Physical memory": "dark-red","Virtual memory": "dark-blue"},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 1,"fillGradient": 1,"gridPos": {"h": 6,"w": 8,"x": 16,"y": 7},"hiddenSeries": false,"hideTimeOverride": false,"id": 49,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "current","sortDesc": true,"total": false,"values": true},"lines": true,"linewidth": 2,"links": [],"nullPointMode": "null","percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [{"alias": "/.*Physical.*/","linewidth": 3}],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"expr": "100.0 - 100 * windows_os_physical_memory_free_bytes / windows_cs_physical_memory_bytes","instant": false,"interval": "","legendFormat": "{{instance}}","refId": "A"}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机内存使用率","tooltip": {"shared": true,"sort": 0,"value_type": "individual"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "percent","label": null,"logBase": 1,"max": null,"min": null,"show": true},{"format": "short","label": null,"logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}},{"aliasColors": {},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 1,"fillGradient": 0,"gridPos": {"h": 6,"w": 8,"x": 0,"y": 13},"hiddenSeries": false,"hideTimeOverride": false,"id": 53,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "max","sortDesc": true,"total": false,"values": true},"lines": true,"linewidth": 1,"links": [],"nullPointMode": "null as zero","percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"application": {"filter": ""},"expr": "max by (instance) (irate(windows_net_bytes_sent_total{nic!~'isatap.*|VPN.*'}[2m]))*8","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_上传","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "B","step": 10},{"application": {"filter": ""},"expr": "-max by (instance) (irate(windows_net_bytes_received_total{nic!~'isatap.*|VPN.*'}[2m]))*8","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_下载","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "A","step": 10}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机网络详情","tooltip": {"shared": true,"sort": 2,"value_type": "individual"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "bps","label": "下载    上传","logBase": 1,"max": null,"min": null,"show": true},{"format": "short","label": null,"logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}},{"aliasColors": {},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 2,"fillGradient": 0,"gridPos": {"h": 6,"w": 8,"x": 8,"y": 13},"hiddenSeries": false,"hideTimeOverride": false,"id": 51,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "max","sortDesc": true,"total": false,"values": true},"lines": true,"linewidth": 1,"links": [],"nullPointMode": "null","percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"application": {"filter": ""},"expr": "-max by (instance) (irate(windows_logical_disk_read_bytes_total[2m]))","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_读取","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "A","step": 20},{"application": {"filter": ""},"expr": "max by (instance) (irate(windows_logical_disk_write_bytes_total[2m]))","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_写入","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "B","step": 20}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机磁盘读写详情","tooltip": {"shared": true,"sort": 2,"value_type": "individual"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "Bps","label": "读取    写入","logBase": 1,"max": null,"min": null,"show": true},{"decimals": null,"format": "iops","label": "","logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}},{"aliasColors": {},"bars": false,"dashLength": 10,"dashes": false,"datasource": "Prometheus","fieldConfig": {"defaults": {"custom": {}},"overrides": []},"fill": 1,"fillGradient": 0,"gridPos": {"h": 6,"w": 8,"x": 16,"y": 13},"hiddenSeries": false,"hideTimeOverride": false,"id": 55,"legend": {"alignAsTable": true,"avg": true,"current": true,"max": true,"min": false,"rightSide": true,"show": false,"sort": "current","sortDesc": true,"total": false,"values": true},"lines": true,"linewidth": 1,"links": [],"nullPointMode": "null as zero","percentage": false,"pluginVersion": "7.1.5","pointradius": 5,"points": false,"renderer": "flot","seriesOverrides": [],"spaceLength": 10,"stack": false,"steppedLine": false,"targets": [{"application": {"filter": ""},"expr": "-max by (instance) (irate(windows_logical_disk_reads_total[2m]))","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_读取","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "B","step": 20},{"application": {"filter": ""},"expr": "max by (instance) (irate(windows_logical_disk_writes_total[2m]))","format": "time_series","functions": [],"group": {"filter": ""},"hide": false,"host": {"filter": ""},"interval": "","intervalFactor": 1,"item": {"filter": ""},"legendFormat": "{{instance}}_写入","metric": "mysql_global_status_questions","mode": 0,"options": {"showDisabledItems": false},"refId": "C","step": 20}],"thresholds": [],"timeFrom": null,"timeRegions": [],"timeShift": null,"title": "各主机磁盘IO详情","tooltip": {"shared": true,"sort": 2,"value_type": "individual"},"type": "graph","xaxis": {"buckets": null,"mode": "time","name": null,"show": true,"values": []},"yaxes": [{"format": "iops","label": "读取    写入","logBase": 1,"max": null,"min": null,"show": true},{"format": "short","label": null,"logBase": 1,"max": null,"min": null,"show": false}],"yaxis": {"align": false,"alignLevel": null}}],"refresh": false,"schemaVersion": 26,"style": "dark","tags": ["Prometheus","windows_exporter"],"templating": {"list": [{"allValue": null,"current": {"selected": false,"text": "Win-76","value": "Win-76"},"datasource": "Prometheus","definition": "label_values(windows_cs_hostname, job)","hide": 0,"includeAll": false,"label": "JOB","multi": false,"name": "job","options": [],"query": "label_values(windows_cs_hostname, job)","refresh": 1,"regex": "","skipUrlSync": false,"sort": 1,"tagValuesQuery": "","tags": [],"tagsQuery": "","type": "query","useTags": false},{"allValue": null,"current": {"selected": false,"text": "All","value": "$__all"},"datasource": "Prometheus","definition": "label_values(windows_cs_hostname{job=~\"$job\"}, hostname)","hide": 0,"includeAll": true,"label": "主机名","multi": false,"name": "hostname","options": [],"query": "label_values(windows_cs_hostname{job=~\"$job\"}, hostname)","refresh": 1,"regex": "","skipUrlSync": false,"sort": 5,"tagValuesQuery": "","tags": [],"tagsQuery": "","type": "query","useTags": false},{"allValue": null,"current": {"selected": false,"text": "10.0.50.76:9182","value": "10.0.50.76:9182"},"datasource": "Prometheus","definition": "label_values(windows_cs_hostname{job=~\"$job\",hostname=~\"$hostname\"}, instance)","hide": 0,"includeAll": false,"label": "instance","multi": false,"name": "instance","options": [],"query": "label_values(windows_cs_hostname{job=~\"$job\",hostname=~\"$hostname\"}, instance)","refresh": 1,"regex": "","skipUrlSync": false,"sort": 5,"tagValuesQuery": "","tags": [],"tagsQuery": "","type": "query","useTags": false},{"allValue": null,"current": {"selected": false,"text": "wangyanfei","value": "wangyanfei"},"datasource": "Prometheus","definition": "label_values(windows_cs_hostname{job=~\"$job\",instance=~\"$instance\"}, hostname)","hide": 2,"includeAll": false,"label": "展示使用的主机名","multi": false,"name": "show_hostname","options": [],"query": "label_values(windows_cs_hostname{job=~\"$job\",instance=~\"$instance\"}, hostname)","refresh": 1,"regex": "","skipUrlSync": false,"sort": 0,"tagValuesQuery": "","tags": [],"tagsQuery": "","type": "query","useTags": false}]},"time": {"from": "now-5m","to": "now"},"timepicker": {"refresh_intervals": ["10s","30s","1m","5m","15m","30m","1h","2h","1d"],"time_options": ["5m","15m","1h","6h","12h","24h","2d","7d","30d"]},"timezone": "","title": "Webvr","uid": "Kdh0OoSGz","version": 17
}

 


http://chatgpt.dhexx.cn/article/aNkM5Tqr.shtml

相关文章

翻译:Irate绘图更精准

原文:Irate graphs are better graphs | Robust Perception Prometheus 0.16.1 was just released, and with it brings my addition of the irate function. This offers more responsive graphs and higher resolution dashboards. 刚刚发布的普罗米修斯 0.16.1&a…

prometheus-rate、irate、increase函数使用场景

rate() rate(v range-vector)计算范围向量中时间序列的每秒平均平均增长率。单调性中断(例如由于目标重启而导致的计数器重置)会自动进行调整。同样,计算会外推到时间范围的末尾,从而允许遗漏刮擦或刮擦周期与该范围的时间段不完…

Prometheus监控 rate与irate的区别

对官网文档的解读irate和rate都会用于计算某个指标在一定时间间隔内的变化速率。但是它们的计算方法有所不同:irate取的是在指定时间范围内的最近两个数据点来算速率,而rate会取指定时间范围内所有数据点,算出一组速率,然后取平均…

Prometheus中 rate、irate、increase函数的使用场景

首先给出Prometheus的文档,建议先了解一下 官方文档 以及本文的参考文档: 参考文档 rate() rate(v range-vector)计算范围向量中时间序列的每秒平均平均增长率。单调性中断(例如由于目标重启而导致的计数器重置)会自动进行调整。…

PromQL 计算Counter指标增长率 rate irate increase

我们知道Counter类型的监控指标其特点是只增不减,在没有发生重置(如服务器重启,应用重启)的情况下其样本值应该是不断增大的。为了能够更直观的表示样本数据的变化剧烈情况,需要计算样本的增长速率。 如下图所示&…

PromQL 平均增长率 rate 函数 瞬时增长率 irate函数 只针对counter指标类型

计算Counter指标增长率 我们知道Counter类型的监控指标其特点是只增不减,在没有发生重置(如服务器重启,应用重启)的情况下其样本值应该是不断增大的。为了能够更直观的表示样本数据的变化剧烈情况,需要计算样本的增长速…

普罗米修斯irate/rate算法区别(原创)

文章目录 irate算法流程特点代码 rate函数流程特点代码 irate算法 流程 选取时间范围内最后两个点:end1,end2 计算两个点的差值,这里分两种情况: ​ 正常情况下:end2 > end1 ,此时 value end2 - end1 ​ 异常情况…

Prometheus-rate与irate源码详解

我们先看prometheus的函数格式 一 类型 var Functions map[string]*Function{..."rate": {Name: "rate",ArgTypes: []ValueType{ValueTypeMatrix},ReturnType: ValueTypeVector,Call: funcRate,},..."irate": {Name: &qu…

Prometheus监控:rate与irate的区别

对官网文档的解读 irate和rate都会用于计算某个指标在一定时间间隔内的变化速率。但是它们的计算方法有所不同:irate取的是在指定时间范围内的最近两个数据点来算速率,而rate会取指定时间范围内所有数据点,算出一组速率,然后取平…

【博客486】prometheus-----rate,irate,increase的原理

prometheus-----rate,irate,increase的原理 三者综合比较 这三个函数接受的都是 Range Vector,返回的是 Instant Vector,比较常用。 区别: rate计算指定时间范围内:增量/时间范围; irate计算指…

【博客650】irate适用于绘制细粒度灵敏图,但警惕用于告警

irate适用于绘制细粒度灵敏图,但警惕用于告警 1、irate解析 作用: irate(v range-vector) 函数用于计算区间向量的增长率,但是其反应出的是瞬时增长率。 原理: irate 函数是通过区间向量中最后两个两本数据来计算区间向量的增长…

git查看用户名和密码

一、查看 查看用户名 :git config user.name 查看密码: git config user.password 查看邮箱:git config user.email 查看配置信息: $ git config --list 二、修改 修改用户名 git config --global user.name “xxxx(新的用户名)”…

Linux中git保存用户名密码

Linux下命令行使用git,每次操作都要输入用户名和密码很麻烦,可以通过配置保存用户名和密码。 进入到git项目的根目录下,打开.git目录下的config文件 cd .git vim config添加如下内容 [credential]helper store:wq保存退出 执行上述操作之…

git设置单个仓库用户名以及密码

有些时候我们的服务器可能要部署多个git仓库,不同git仓库的用户名以及密码都是不一样的,此时需要我们设置单个仓库的用户名以及密码。 1.git设置用户名以及邮箱 命令如下: git config user.name "userName" //你的用户名 …

git 修改用户名和密码

windows 在控制面板修改凭证就可以进行修改用户名密码。 Linux 执行vim ~/.git-credentials,可以看到被保存的账号密码,删掉、修改或新增都可以! eg:http://账号:密码git仓库http地址或用https://账号:密码git仓库http地址 h…

mac下git设置用户名密码

设置用户名和邮箱 git config --global user.name [username] git config --global user.email [email] 查看用户名和邮箱 git config --global user.name git config --global user.email 查看配置文件 git config --list 编辑配置文件 vi .gitconfig sourcetree中的…

linux 分配git用户名和密码,配置Git记住用户名密码的俩种方法

前言 相信大家在使用github过程中,也有这情况,总是让大家输入烦人的用户名,密码,浪费时间。下面这俩种办法也是网上找来的,我做了些整合,避免大家走入当时跟我一样的坑中。 方法一 1.1创建文件储存git用户名…

git重新设置用户名密码

设置密码 我们输入git config --global user.name "youname"设置密码,在输入git config --global user.email "aaqq.com"设置邮箱

git设置用户名、密码和邮箱(全局设置)

(1)git设置用户名(如下图一): git config --global user.name Urasaki (2)git设置密码(如下图一): git config --global user.password Am100100 &#xff…