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

文章目录

  • 一、采集器插件
    • 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)
dostr=`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.hqwc.cn/news/572650.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

6.二叉树——2.重建树

已知先序和中序序列 根据先序序列找到树根根据树根和中序序列找到左右子树 同理根据后序序列和中序序列也能重构树,但前序和后序不可以 递归coding思路 设先序序列为preorder[n],中序序列为midorder[n] 大事化小: 确定根,即树…

uniapp写小程序如何实现分包

众所众知小程序上传的过程中对包的大小有限制,正常情况下不允许当个包超过2M,所以需要分包 需要再pages.json这个文件夹中进行配置 "pages": [{"path": "pages/index/index","style": {"navigationBarTit…

基于java实现学科竞赛管理系统【Springboot+mybatis+layui】

基于java实现学科竞赛管理系统【Springbootmybatislayui】 博主介绍:多年java开发经验,专注Java开发、定制、远程、文档编写指导等,csdn特邀作者、专注于Java技术领域 作者主页 央顺技术团队 Java毕设项目精品实战案例《1000套》 欢迎点赞 收藏 ⭐留言 文…

UMass、MIT等提出3D世界具身基础模型,机器人根据生成的世界模型无缝连接3D感知、推理和行动

在最近的研究中,视觉-语言-动作(VLA,vision-language-action)模型的输入基本都是2D数据,没有集成更通用的3D物理世界。 此外,现有的模型通过学习「感知到动作的直接映射」来进行动作预测,忽略了…

流量调度平台:优化资源配置,提升用户体验

随着互联网和移动互联网的快速发展,流量调度平台作为一种关键的技术解决方案,正成为各行业提高资源利用率、优化用户体验的重要工具。本文将深入探讨流量调度平台的意义、特点以及在不同领域的应用场景。 ### 什么是流量调度平台? 流量调度…

Hive3.0.0出库库表中timestamp字段读取为null

在利用sqoop1.99.7做数据迁移的时候,从mysql导出表格到hive建立对应的表格,字段中使用了timestamp类型,在读取数据的时候,发现数据为null。查找问题方法如下: 1、查询库表字段类型 命令:desc tablen…

R使用multinma程序包实现生存数据的贝叶斯网状meta分析

前言 multinma是由Phillippo开发的程序包,主要用来实现基于IPD校准的多水平网状Meta回归(ML-NMR),同时该程序包也可以用来实现传统的网状meta分析。今天的文章介绍如何使用multinma程序包实现生存数据的贝叶斯网状meta分析&#…

学习JavaEE的日子 Day29 yield,join,线程的中断,守护线程,线程局部变量共享,线程生命周期

Day29 多线程 12. 线程的礼让 Thread.yield(); 理解:此方法为静态方法,此方法写在哪个线程中,哪个线程就礼让 注意:所谓的礼让是指当前线程退出CPU资源,并转到就绪状态,接着再抢 需求:创建两个…

SPRING-BOOT实现HTTP大文件断点续传分片下载

版本:6.5.40 代码:up6-jsp-springboot: Web大文件上传-jsp-springboot示例 - Gitee.com nosql示例 nosql示例不需要进行任何配置,可以直接访问测试。 SQL示例 1.创建数据库 2.配置数据库连接 3.自动下载maven依赖 4.启动项目 启动成功 6.访…

肿瘤靶向肽 iRGD peptide环肽 1392278-76-0 c(CRGDKGPDC)

RGD环肽 c(CRGDKGPDC),iRGD peptide 1392278-76-0 结 构 式: H2N-CRGDKGPDC-OH(Disulfide Bridge:C1-C9) H2N-Cys-Arg-Gly-Asp-Lys-Gly-Pro-Asp-Cys-COOH(Disulfide Bridge:Cys1-Cys9) 氨基酸个数: 9 C35H57N13O14S2 平均分子量:…

【机器学习之旅】概念启程、步骤前行、分类掌握与实践落地

🎈个人主页:豌豆射手^ 🎉欢迎 👍点赞✍评论⭐收藏 🤗收录专栏:机器学习 🤝希望本文对您有所裨益,如有不足之处,欢迎在评论区提出指正,让我们共同学习、交流进…

国赛大纲解读

1. 第一部分,是针对5G基础知识的掌握,第二部分是人工智能基本算法的掌握,就是人工智能的应用,用5G+人工智能(AI算法)进行网络优化的问题,要有网络优化的基础知识,比如说:某个区域的覆盖问题,覆盖特别差,但有数据,覆盖电频,srp值这些数据给你,根据数据来判断是…