服务器监控软件夜莺采集监控(三)

news2024/11/18 4:32:59

文章目录

  • 一、采集器插件
    • 1. exec插件
    • 2. rabbitmq插件
    • 3. elasticsearch插件
  • 二、监控仪表盘
    • 1. 系统信息
    • 2. 数据服务
    • 3. NginxMQ
    • 4. Docker
    • 5. 业务日志


一、采集器插件

1. exec插件

input.exec/exec.toml

[[instances]]
commands = [
     "/home/monitor/categraf/scripts/*.sh"
]

例如统计minio桶的文件数 minio_statis.sh
chmod 777 /home/monitor/categraf/scripts/minio_statis.sh

#!/bin/bash
dir=/home/minio/data
agent=home-12-基础

for item in $(ls $dir)
do
  str=`find $dir/$item -name "*xl.meta" | wc -l`
  result=`echo $result$item"_num="$str","`
  echo "metric_minio,agent_hostname="$agent",instance="$item" num="$str
done

2. rabbitmq插件

  • input.rabbitmq/rabbitmq.toml
[[instances]]
url = "http://192.168.6.12:15672"
labels = { instance="home-12" }
username = "admin"
password = "123456"

3. elasticsearch插件

  • input.elasticsearch/elasticsearch.toml
[[instances]]
labels = { instance="home-12" }
servers = ["http://192.168.6.12:9200"]
username = "elastic"
password = "123456"

http_timeout = "10s"
local = false
cluster_health = true
cluster_health_level = "cluster"
cluster_stats = true
indices_level = ""
node_stats = ["jvm", "breaker", "process", "os", "fs", "indices", "thread_pool", "transport"]
num_most_recent_indices = 1

二、监控仪表盘

1. 系统信息

  • 仪表盘 JSON
{
    "name": "01.  系统信息",
    "tags": "",
    "ident": "",
    "configs": {
        "panels": [
            {
                "type": "table",
                "id": "77bf513a-8504-4d33-9efe-75aaf9abc9e4",
                "layout": {
                    "h": 5,
                    "w": 24,
                    "x": 0,
                    "y": 0,
                    "i": "77bf513a-8504-4d33-9efe-75aaf9abc9e4",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "avg(system_uptime{ident=~\"$ident\"}) by (ident)",
                        "refId": "A",
                        "legend": "启动时长"
                    },
                    {
                        "expr": "avg(cpu_usage_active{cpu=\"cpu-total\", ident=~\"$ident\"}) by (ident)",
                        "legend": "CPU使用率",
                        "refId": "B"
                    },
                    {
                        "expr": "avg(mem_used_percent{ident=~\"$ident\"}) by (ident)",
                        "legend": "内存使用率",
                        "refId": "C"
                    },
                    {
                        "expr": "avg(mem_total{ident=~\"$ident\"}) by (ident)",
                        "legend": "总内存",
                        "refId": "D"
                    },
                    {
                        "expr": "avg(disk_used_percent{ident=~\"$ident\",path=\"/\"}) by (ident)",
                        "legend": "硬盘使用率",
                        "refId": "E"
                    },
                    {
                        "expr": "avg(disk_total{ident=~\"$ident\"}) by (ident)",
                        "refId": "F",
                        "legend": "总硬盘"
                    },
                    {
                        "expr": "avg(nvidia_smi_utilization_gpu_ratio{ident=~\"$ident\"}) by (ident)",
                        "refId": "I",
                        "legend": "GPU使用率"
                    },
                    {
                        "expr": "avg(nvidia_smi_memory_used_bytes/nvidia_smi_memory_total_bytes{ident=~\"$ident\"}) by (ident)",
                        "refId": "J",
                        "legend": "显存使用率"
                    },
                    {
                        "expr": "avg(nvidia_smi_memory_total_bytes{ident=~\"$ident\"}) by (ident)",
                        "refId": "K",
                        "legend": "总显存"
                    },
                    {
                        "expr": "ntp_offset_ms",
                        "refId": "L",
                        "legend": "NTP偏移 ms"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {
                            "renameByName": {
                                "ident": "机器"
                            }
                        }
                    }
                ],
                "name": "机器列表",
                "maxPerRow": 4,
                "custom": {
                    "showHeader": true,
                    "colorMode": "background",
                    "calc": "lastNotNull",
                    "displayMode": "labelValuesToRows",
                    "aggrDimension": "ident",
                    "sortColumn": "ident",
                    "sortOrder": "ascend",
                    "linkMode": "cellLink"
                },
                "options": {
                    "standardOptions": {}
                },
                "overrides": [
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "A"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "humantimeSeconds"
                            }
                        }
                    },
                    {
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "B"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "percent",
                                "decimals": 1
                            },
                            "valueMappings": []
                        }
                    },
                    {
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "C"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "percent",
                                "decimals": 1
                            },
                            "valueMappings": []
                        },
                        "type": "special"
                    },
                    {
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "D"
                        },
                        "properties": {
                            "standardOptions": {
                                "decimals": 1,
                                "util": "bytesIEC"
                            },
                            "valueMappings": []
                        },
                        "type": "special"
                    },
                    {
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "E"
                        },
                        "properties": {
                            "standardOptions": {
                                "decimals": 1,
                                "util": "percent"
                            },
                            "valueMappings": []
                        },
                        "type": "special"
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "F"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "bytesIEC",
                                "decimals": 0
                            }
                        }
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "G"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "bytesSecIEC",
                                "decimals": 1
                            }
                        }
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "H"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "bytesSecIEC",
                                "decimals": 1
                            }
                        }
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "I"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "percentUnit",
                                "decimals": 1
                            }
                        }
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "J"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "percentUnit",
                                "decimals": 1
                            }
                        }
                    },
                    {
                        "type": "special",
                        "matcher": {
                            "id": "byFrameRefID",
                            "value": "K"
                        },
                        "properties": {
                            "standardOptions": {
                                "util": "bytesIEC",
                                "decimals": 1
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "043c26de-d19f-4fe8-a615-2b7c10ceb828",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 0,
                    "y": 5,
                    "i": "043c26de-d19f-4fe8-a615-2b7c10ceb828",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "cpu_usage_active{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "CPU使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "percent",
                        "min": 0,
                        "max": 101,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "307a57fd-4bc5-465b-9c63-bfa702e3cbca",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 8,
                    "y": 5,
                    "i": "d4669ebe-2a79-4316-be78-22d0075a22dc",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mem_used_percent{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "内存使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "percent",
                        "min": 0,
                        "max": 101,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "decimals": null,
                                "min": null,
                                "max": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "239aacdf-1982-428b-b240-57f4ce7f946d",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 16,
                    "y": 5,
                    "i": "239aacdf-1982-428b-b240-57f4ce7f946d",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "avg(rate(net_bytes_sent{ident=~\"$ident\"}[1m])) by(ident)",
                        "refId": "A",
                        "legend": "{{ident}}-出",
                        "maxDataPoints": 240
                    },
                    {
                        "expr": "avg(rate(net_bytes_recv{ident=~\"$ident\"}[1m])) by(ident)",
                        "refId": "B",
                        "maxDataPoints": 240,
                        "legend": "{{ident}}-入"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "网络流量",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "bytesIEC",
                        "min": 0,
                        "max": 10000001,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "decimals": null,
                                "min": 0,
                                "max": 10000001,
                                "util": "bytesIEC"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "f7d7c3ca-6fe8-4d3d-a5c5-609f2a1e0bc8",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 0,
                    "y": 15,
                    "i": "533e66d4-8b10-4871-97a3-c10aee4beec0",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "avg(rate(diskio_read_bytes{ident=~\"$ident\"}[1m])) by(ident)",
                        "refId": "A",
                        "legend": "{{ident}}-读",
                        "maxDataPoints": 240
                    },
                    {
                        "expr": "avg(rate(diskio_write_bytes{ident=~\"$ident\"}[1m])) by(ident)",
                        "refId": "B",
                        "maxDataPoints": 240,
                        "legend": "{{ident}}-写"
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "磁盘IO",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "bytesSecIEC",
                        "min": 0,
                        "max": 20000001,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "decimals": null,
                                "min": 0,
                                "max": 20000001,
                                "util": "bytesIEC"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "8b9dd6ef-b91c-41ac-8a08-b0f02df5103f",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 8,
                    "y": 15,
                    "i": "7246581a-58a8-4670-b6ae-77c4c493cc39",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "nvidia_smi_utilization_gpu_ratio{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "GPU使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "percent",
                        "min": 0,
                        "max": 101,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "decimals": null,
                                "min": null,
                                "max": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "ef1b2e1a-bdc1-49c5-b077-1596afc6341f",
                "layout": {
                    "h": 10,
                    "w": 8,
                    "x": 16,
                    "y": 15,
                    "i": "357648f3-4712-47f1-8b1e-efc944568024",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "nvidia_smi_memory_used_bytes/nvidia_smi_memory_total_bytes{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "显存使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "percent",
                        "min": 0,
                        "max": 101,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "decimals": null,
                                "min": null,
                                "max": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            }
        ],
        "var": [
            {
                "definition": "prometheus",
                "name": "prom",
                "type": "datasource"
            },
            {
                "allOption": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${prom}"
                },
                "definition": "label_values(system_load1,ident)",
                "multi": true,
                "name": "ident",
                "type": "query"
            }
        ],
        "version": "3.0.0"
    }
}
  • 仪表盘 效果

在这里插入图片描述

2. 数据服务

  • 仪表盘 JSON
{
    "name": "02.  数据服务",
    "tags": "",
    "ident": "",
    "configs": {
        "panels": [
            {
                "type": "timeseries",
                "id": "043c26de-d19f-4fe8-a615-2b7c10ceb828",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 0,
                    "y": 0,
                    "i": "043c26de-d19f-4fe8-a615-2b7c10ceb828",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mysql_global_status_threads_connected{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "MySQL 连接数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 1001,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "bbd1ebda-99f6-419c-90a5-5f84973976dd",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 8,
                    "y": 0,
                    "i": "bbd1ebda-99f6-419c-90a5-5f84973976dd",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mysql_global_status_slow_queries{ident=~\"$ident\"}",
                        "legend": "{{instance}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "MySQL 慢查询数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "max",
                            "min",
                            "avg"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 11,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "52e33e43-116b-4dab-bcdc-56b1adeeddf6",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 16,
                    "y": 0,
                    "i": "b2d01115-0661-467f-9188-07fc7e7fb98f",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mysql_global_status_table_locks_waited{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "MySQL 锁表等待次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 11,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "2674442f-937f-4027-806b-10b2286b14f6",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 0,
                    "y": 9,
                    "i": "c8c061df-894d-458e-a89d-86a8428c52c9",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "redis_used_memory{ident=~\"$ident\"}",
                        "legend": "{{instance}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Redis 使用内存",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 102400000,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "7efbb799-d0f6-4843-a63d-78ef999908de",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 16,
                    "y": 9,
                    "i": "7a326a5e-b29c-445c-87ed-d0937841403e",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "elasticsearch_indices_docs_count{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Elasticsearch 文档数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0.01,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "093b192e-e991-4590-ab4b-aa768159e00f",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 8,
                    "y": 10,
                    "i": "a18a3bd3-8c2b-4fa2-81f3-7b0d00b49cc9",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "metric_minio_num{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}-{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "MinIO 文件数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "asc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0.01,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null
                            }
                        }
                    }
                ]
            }
        ],
        "var": [
            {
                "definition": "prometheus",
                "name": "prom",
                "type": "datasource"
            },
            {
                "allOption": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${prom}"
                },
                "definition": "label_values(system_load1,ident)",
                "multi": true,
                "name": "ident",
                "type": "query"
            }
        ],
        "version": "3.0.0"
    }
}
  • 仪表盘 效果

在这里插入图片描述

3. NginxMQ

  • 仪表盘 JSON
{
    "name": "03.  NginxMQ",
    "tags": "",
    "ident": "",
    "configs": {
        "panels": [
            {
                "type": "timeseries",
                "id": "767492a9-0702-445e-aeb6-4014813b5282",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 0,
                    "y": 0,
                    "i": "dc35b201-192d-4187-b109-1a7e6a1e78f1",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "nginx_writing{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{product}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx 响应到客户端数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "37f1e8f4-35fc-4ea4-b3fe-8a40a873905c",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 8,
                    "y": 0,
                    "i": "cfc2c974-98fd-4d3e-ba3a-0ab26b016f66",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "nginx_active{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{product}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx 活跃连接数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "4b21fb9f-04ff-48d3-b31a-89162a16742a",
                "layout": {
                    "h": 9,
                    "w": 8,
                    "x": 16,
                    "y": 0,
                    "i": "cf817c2a-ed9b-4862-84c6-335b57272223",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "nginx_requests{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{product}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx 客户端请求总数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "1fa095e0-5a2d-4123-922d-fd364d2ee1ad",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 0,
                    "y": 9,
                    "i": "2193e193-f644-4b7b-a55c-95b481fa29c0",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "rabbitmq_overview_queues{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "RabbitMQ 队列数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "1eb4379d-8211-4142-b9c9-f0649849fc4f",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 8,
                    "y": 9,
                    "i": "450cb365-50a5-45d9-baa6-776aca81d158",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "rabbitmq_overview_connections{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "RabbitMQ 连接数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "1d73c14d-b788-41b1-9e91-573502403553",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 16,
                    "y": 9,
                    "i": "9cf523b7-8aa4-4098-90be-3dccc6e5411c",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "rabbitmq_overview_channels{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{instance}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "RabbitMQ 信道数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": null,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            }
        ],
        "var": [
            {
                "definition": "prometheus",
                "name": "prom",
                "type": "datasource"
            },
            {
                "allOption": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${prom}"
                },
                "definition": "label_values(system_load1,ident)",
                "multi": true,
                "name": "ident",
                "type": "query"
            }
        ],
        "version": "3.0.0"
    }
}
  • 仪表盘 效果

在这里插入图片描述

4. Docker

  • 仪表盘 JSON
{
    "name": "04.  Docker",
    "tags": "",
    "ident": "",
    "configs": {
        "panels": [
            {
                "type": "timeseries",
                "id": "0cb01432-ea29-41f4-8e6f-e6b9b71e90ab",
                "layout": {
                    "h": 16,
                    "w": 8,
                    "x": 0,
                    "y": 0,
                    "i": "8bf97e38-e840-4804-a686-28bb65fec78d",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "docker_n_containers_running{ident=~\"$ident\"}",
                        "refId": "A",
                        "legend": "{{ident}}",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Docker 启动容器数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 17,
                        "decimals": null
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "min": null,
                                "max": null,
                                "decimals": null,
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "557d0446-69a9-4a29-b905-730afdc09bbc",
                "layout": {
                    "h": 16,
                    "w": 8,
                    "x": 8,
                    "y": 0,
                    "i": "b0ee6fe3-7db0-4089-8158-80efffd1f6ed",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "docker_container_mem_usage{ident=~\"$ident\"}",
                        "legend": "{{ident}}-{{container_name}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Docker 内存使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "max": 3072000000,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "936b934b-6340-4743-8c12-821c63210fd6",
                "layout": {
                    "h": 16,
                    "w": 8,
                    "x": 16,
                    "y": 0,
                    "i": "c6da1998-c1e3-4486-a24c-58e26d349206",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "docker_container_cpu_usage_percent{ident=~\"$ident\"}",
                        "legend": "{{ident}}-{{container_name}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Docker CPU使用率",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "util": "percent",
                        "min": 0,
                        "max": 101,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "util": "none",
                                "min": null,
                                "max": null
                            }
                        }
                    }
                ]
            }
        ],
        "var": [
            {
                "definition": "prometheus",
                "name": "prom",
                "type": "datasource"
            },
            {
                "allOption": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${prom}"
                },
                "definition": "label_values(system_load1,ident)",
                "multi": true,
                "name": "ident",
                "type": "query"
            }
        ],
        "version": "3.0.0"
    }
}
  • 仪表盘 效果
    在这里插入图片描述

5. 业务日志

  • 仪表盘 JSON
{
    "name": "05.  业务日志",
    "tags": "",
    "ident": "",
    "configs": {
        "panels": [
            {
                "type": "timeseries",
                "id": "d26e8bc3-16a0-4a60-9aa9-36d71b85abc5",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 0,
                    "y": 0,
                    "i": "0a3310ea-74ca-48fa-8c18-52c1b0f71235",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_nginx_post_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx POST 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "f1c9413e-e19a-4e2c-ab2e-3c8987de48fc",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 8,
                    "y": 0,
                    "i": "2a8c88a5-25fe-4ef5-8d17-c04250ddfd93",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_nginx_get_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx GET 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "eebdc132-61ea-4b32-a9d9-dd1e82417b6a",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 16,
                    "y": 0,
                    "i": "1262bf57-0dea-4e78-9bc8-42cd0526ecc6",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_nginx_error_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "Nginx ERROR 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off",
                            "standardOptions": {
                                "util": "none"
                            }
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "bf8c79fb-94ee-4f01-b881-47cc0c522895",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 0,
                    "y": 8,
                    "i": "d6bbbc05-ab62-446d-a1d1-3edf5529e9fc",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_app_info_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "系统 INFO 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "984ae397-5f24-4eae-bfea-eab879979ae3",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 8,
                    "y": 8,
                    "i": "b13ed448-544b-4c0e-b3c8-512412ec2181",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_app_error_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "系统 ERROR 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            },
            {
                "type": "timeseries",
                "id": "95f151d2-4f8c-4922-952b-ff4241edf964",
                "layout": {
                    "h": 8,
                    "w": 8,
                    "x": 16,
                    "y": 8,
                    "i": "198c29b0-c2b7-45eb-b3c4-90824ddeebb1",
                    "isResizable": true
                },
                "version": "3.0.0",
                "datasourceCate": "prometheus",
                "datasourceValue": "${prom}",
                "targets": [
                    {
                        "expr": "mtail_ser_login_num{ident=~\"$ident\"}",
                        "legend": "{{log}}",
                        "refId": "A",
                        "maxDataPoints": 240
                    }
                ],
                "transformations": [
                    {
                        "id": "organize",
                        "options": {}
                    }
                ],
                "name": "登录 次数",
                "maxPerRow": 4,
                "options": {
                    "tooltip": {
                        "mode": "all",
                        "sort": "desc"
                    },
                    "legend": {
                        "displayMode": "table",
                        "columns": [
                            "last",
                            "avg",
                            "max",
                            "min"
                        ],
                        "behaviour": "showItem"
                    },
                    "standardOptions": {
                        "min": 0,
                        "decimals": 0
                    },
                    "thresholds": {
                        "steps": [
                            {
                                "color": "#634CD9",
                                "value": null,
                                "type": "base"
                            }
                        ]
                    }
                },
                "custom": {
                    "drawStyle": "lines",
                    "lineInterpolation": "smooth",
                    "spanNulls": false,
                    "lineWidth": 2,
                    "fillOpacity": 0,
                    "gradientMode": "none",
                    "stack": "off",
                    "scaleDistribution": {
                        "type": "linear"
                    }
                },
                "overrides": [
                    {
                        "matcher": {
                            "id": "byFrameRefID"
                        },
                        "properties": {
                            "rightYAxisDisplay": "off"
                        }
                    }
                ]
            }
        ],
        "var": [
            {
                "definition": "prometheus",
                "name": "prom",
                "type": "datasource"
            },
            {
                "allOption": true,
                "datasource": {
                    "cate": "prometheus",
                    "value": "${prom}"
                },
                "definition": "label_values(system_load1,ident)",
                "multi": true,
                "name": "ident",
                "type": "query"
            }
        ],
        "version": "3.0.0"
    }
}
  • 仪表盘 效果

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1550271.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

区块链食品溯源案例实现(一)

引言: 食品安全问题一直是社会关注的热点,而食品溯源作为解决食品安全问题的重要手段,其重要性不言而喻。传统的食品溯源系统往往存在数据易被篡改、信息不透明等问题,而区块链技术的引入,为食品溯源带来了革命性的变革…

第十篇【传奇开心果系列】Python自动化办公库技术点案例示例:深度解读Python自动化操作Excel

传奇开心果博文系列 系列博文目录Python自动化办公库技术点案例示例系列博文目录 前言一、重要作用解说二、Python操作Excel的常用库介绍三、数据处理和分析示例代码四、自动化报表生成示例代码五、数据导入和导出示例代码六、数据可视化示例代码八、数据校验和清洗示例代码九、…

数据结构——第5章 树和二叉树

1 二叉树 二叉树和树都属于树形结构,但两者互不包含。即二叉树不是特殊的树。 1.1 二叉树的基本概念 1.2 二叉树的顺序存储 仅适用于完全二叉树 #define MaxSize 100 typedef int ElemType; typedef struct TreeNode{ElemType value;//结点中的数据元素bool isE…

【面试】Elasticsearch 在部署时,对 Linux 的设置有哪些优化方法?

Elasticsearch 在部署时,对 Linux 的设置有哪些优化方法? Elasticsearch是一个分布式搜索和分析引擎,它在Linux环境下的性能和稳定性可以通过一些优化方法进行提升。以下是一些针对Linux环境下Elasticsearch部署的优化方法: 1. 内…

OSG编程指南<二十一>:OSG视图与相机视点更新设置及OSG宽屏变形

1、概述 什么是视图?在《OpenGL 编程指南》中有下面的比喻,从笔者开始学习图形学就影响深刻,相信对读者学习场景管理也会非常有帮助。 产生目标场景视图的变换过程类似于用相机进行拍照,主要有如下的步骤: (1)把照相机固定在三脚架上,让它对准场景(视图变换)。 (2)…

spring安全框架之Shiro

Shiro 一、现存问题 1.1 现存问题 认证(登录):认证操作流程都差不多,但是每次都需要手动的基于业务代码去实现,很麻烦! 授权:如果权限控制粒度比较粗,可以自身去实现&#xff0c…

算法打卡day19

今日任务: 1)235. 二叉搜索树的最近公共祖先 2)701.二叉搜索树中的插入操作 3)450.删除二叉搜索树中的节点 235. 二叉搜索树的最近公共祖先 题目链接:235. 二叉搜索树的最近公共祖先 - 力扣(LeetCode&…

Mysql数据库——高级SQL语句补充

目录 一、子查询——Subquery 1.环境准备 2.In——查询已知的值的数据记录 2.1子查询——Insert 2.2子查询——Update 2.3子查询——Delete 3.Not In——表示否定,不在子查询的结果集里 3.Exists——判断查询结果集是否为空 4.子查询——别名 二、视图—…

政安晨:【Keras机器学习实践要点】(六)—— 使用内置方法进行训练和评估

政安晨的个人主页:政安晨 欢迎 👍点赞✍评论⭐收藏 收录专栏: TensorFlow与Keras实战演绎机器学习 希望政安晨的博客能够对您有所裨益,如有不足之处,欢迎在评论区提出指正! 本文涵盖使用内置 API 进行训练和验证&#…

pytorch+tensorboard

安装依赖 pip install teorboard pip install torch_tb_profiler了解teorboard 记录并可视化标量[组]、图片[组]。 如何使用 第一步:构建模型,记录中间值,写入summarywriter 每次写入一个标量add_scalar 比如: from torch.u…

深度学习:基于PyTorch的模型解释工具Captum

深度学习:基于PyTorch的模型解释工具Captum 引言简介示例安装解释模型的预测解释文本模型情绪分析问答 解释视觉模型特征分析特征消融鲁棒性 解释多模态模型 引言 当我们训练神经网络模型时,我们通常只关注模型的整体性能,例如准确率或损失函…

上位机图像处理和嵌入式模块部署(qmacvisual区域提取)

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing 163.com】 在图像处理中,有两部分比较重要,一个是区域分割,一个是区域提取。区域分割,比较好理解,…

Chrome 插件 storage API 解析

Chrome.storage API 解析 使用 chrome.storage API 存储、检索和跟踪用户数据的更改 一、各模块中的 chrome.storage 内容 1. Service worker 中 runtime 内容 2. Action 中 runtime 内容 3. Content 中 runtime 内容 二、权限(Permissions) 如果需使…

SPU赋能PSI:探秘隐私集合求交核心技术与高级调度架构实践

1.SPU实现的PSI介绍 1.PSI的定义和种类 隐私集合求交(Private Set Intersection, PSI)是一种在密码学和安全多方计算(MPC)领域中的关键技术,允许两个或多个参与者在不泄露各自输入集合中非交集部分的前提下&#xff…

【python分析实战】成本:揭示电商平台月度开支与成本结构占比 - 过于详细 【收藏】

重点关注本文思路,用python分析,方便大家实验复现,代码每次都用全量的,其他工具自行选择。 全文3000字,阅读10min,操作1小时 企业案例实战欢迎关注专栏 每日更新:https://blog.csdn.net/cciehl/…

深入理解element-plus table二次封装:从理论到实践的全面指南

前言 在许多中后台管理系统中,表格占据着半壁江山,如果使用element plus组件库,那么少不了要用到table组件,可是table组件的功能过于基础,因此,我在table组件的实现基础之上进一步封装,从而实现…

2024-03-24 需求分析-智能问答系统-调研

一. 需求列表 基于本地知识库的问答系统对接外围系统 数字人语音识别二. 待调研的公司 2.1 音视贝 AI智能外呼_大模型智能客服系统_大模型知识库系统_杭州音视贝 (yinshibei.com) 2.2 得助智能 智能AI客服机器人-智能电话机器人客服-电话电销机器人-得助智能 (51ima.com) 2…

【LVGL-使用SquareLine Studio设计器 】

LVGL-使用SquareLine Studio设计器 ■ 简介■ 安装■ SquareLine Studio移植到工程 ■ 简介 SquareLine Studio 设计器是一个付费软件。 ■ 安装 SquareLine Studio 设计器的下载地址 我们点击“WINDOWS”下载 SquareLine Studio 设计器,下载完成之后我们就会得到…

ActiveMQ Artemis 系列| High Availability 主备模式(消息复制) 版本2.19.1

一、ActiveMQ Artemis 介绍 Apache ActiveMQ Artemis 是一个高性能的开源消息代理,它完全符合 Java Message Service (JMS) 2.0 规范,并支持多种通信协议,包括 AMQP、MQTT、STOMP 和 OpenWire 等。ActiveMQ Artemis 由 Apache Software Foun…

Android 性能优化实例分享-内存优化 兼顾效率与性能

背景 项目上线一段时间后,回顾重要页面 保证更好用户体验及生产效率,做了内存优化和下载导出优化,具体效果如最后的一节的表格所示。 下面针对拍摄流程的两个页面 预览页 导出页优化实例进行介绍: 一.拍摄前预览页面优化 预览效果问题 存在…