集群监控
udbcluster-exporter 用于暴漏udb-cluster运行指标,管理员可以根据这些指标全面掌握数据库运行情况,结合prometheus+grafana,可以实现图形展示及报警功能;
安装配置
下载程序
联系技术支持获取程序
配置udbcluster目标
export DATA_SOURCE_NAME="udbsql://user:password@hostname:port/dbname?sslmode=disable"
user,password为udb的账号密码,dbname为udb的库名
启动程序
udbc_exporter --web.listen-address=":9719" &`
验证
http://ip:9719/metrics
即可显示检测指标
更多运行参数
help
显示帮助信息.version
打印版本信息.web.listen-address
监听地址端口. (默认”:9719”).web.telemetry-path
指标路径. (默认 “/metrics”)web.enable-exporter-metrics
添加此参数会输出gc相关指标. 默认关闭log.level
日志级别 debug, info, warn, error.log.format
日志格式 logfmt, json.
对接prometheus
配置prometheus自动发现
在 prometheus.yml 添加以下内容
scrape_configs:
- job_name: 'udbcluster'
file_sd_configs:
- files:
- "/etc/prometheus/job_discovery/udbcluster.yml"
refresh_interval: 5s
relabel_configs:
- source_labels: [__source__]
regex: (.*)
target_label: instance
replacement: $1
添加目标
/etc/prometheus/job_discovery/udbcluster.yml
- targets: ["192.168.2.70:9719"]
labels:
__source__: "192.168.2.91"
- targets: ["192.168.2.70:9718"]
labels:
__source__: "192.168.2.92"
重启prometheus
验证
http://prometheus地址:端口/targets 页面会发现添加的udb目标
Grafana 图形展示
导入以下json数据到grafana 即可。
注:
以下模板是在Grafana v9.2.1 创建,不同版本可能存在兼容性。
从pdf复制时,在分页处可能会导致json格式错乱。可使用附件中的json文件。
{
"__inputs": [
{
"name": "Prometheus",
"label": "Prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
],
"__requires": [
{
"type": "panel",
"id": "gauge",
"name": "Gauge",
"version": ""
},
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "9.1.6"
},
{
"type": "datasource",
"id": "prometheus",
"name": "Prometheus",
"version": "1.0.0"
},
{
"type": "panel",
"id": "stat",
"name": "Stat",
"version": ""
},
{
"type": "panel",
"id": "timeseries",
"name": "Time series",
"version": ""
}
],
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 10,
"links": [],
"liveNow": false,
"panels": [
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 28,
"panels": [],
"title": "Row title",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "yf3j0hH4k"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [
{
"options": {
"0": {
"color": "red",
"index": 1,
"text": "DOWN"
},
"1": {
"color": "green",
"index": 0,
"text": "UP"
}
},
"type": "value"
}
],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "#73BF69",
"value": null
},
{
"color": "green",
"value": 1
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 24,
"x": 0,
"y": 1
},
"id": 4,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "vertical",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.2.1",
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"exemplar": false,
"expr": "udbc_unvdbcluster_nodes_status{hostname=~\"$backend_nodes\"}",
"hide": false,
"instant": true,
"interval": "",
"legendFormat": "{{hostname}}-{{role}}",
"range": false,
"refId": "A"
}
],
"title": "Backend Status",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "yf3j0hH4k"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#EAB839",
"value": 80
},
{
"color": "red",
"value": 90
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 0,
"y": 7
},
"id": 2,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true,
"text": {
"titleSize": 1
}
},
"pluginVersion": "9.2.1",
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_frontend_used_ratio",
"legendFormat": "{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Active Connections Ratio",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "yf3j0hH4k"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byFrameRefID",
"options": "B"
},
"properties": [
{
"id": "color",
"value": {
"mode": "continuous-reds"
}
}
]
}
]
},
"gridPos": {
"h": 6,
"w": 8,
"x": 8,
"y": 7
},
"id": 6,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.1.6",
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_frontend_used",
"hide": false,
"legendFormat": "{{__name__}}",
"range": true,
"refId": "A"
},
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_frontend_total",
"hide": false,
"legendFormat": "{{instance}}",
"range": true,
"refId": "B"
}
],
"title": "Active Connectios",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "bytes"
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 8,
"x": 16,
"y": 7
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_nodes_replication_delay{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
},
{
"datasource": "Prometheus",
"hide": false,
"refId": "B"
}
],
"title": "Replication delay",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 13
},
"id": 26,
"panels": [],
"title": "Error Message Counts",
"type": "row"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 7,
"x": 0,
"y": 14
},
"id": 12,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_error_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Error Message Counts",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 7,
"x": 7,
"y": 14
},
"id": 14,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_fatal_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Fatal Message Counts",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 7,
"x": 14,
"y": 14
},
"id": 16,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_panic_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Panic Message Counts",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 22
},
"id": 24,
"panels": [],
"title": "SQL Command Statistics",
"type": "row"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 0,
"y": 23
},
"id": 30,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_select_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "SELECT statement counts",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 7,
"y": 23
},
"id": 36,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_delete_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "DELETE statement counts",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 14,
"y": 23
},
"id": 34,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_insert_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "INSERT statement counts",
"type": "timeseries"
},
{
"datasource": "Prometheus",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 0,
"y": 29
},
"id": 32,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_update_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "UPDATE statement counts",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 7,
"y": 29
},
"id": 38,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_ddl_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "DDL statement counts",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 6,
"w": 7,
"x": 14,
"y": 29
},
"id": 40,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_backend_stats_other_cnt{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Other statement counts",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 35
},
"id": 22,
"panels": [],
"title": "Row title",
"type": "row"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 0,
"y": 36
},
"id": 52,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_total_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of health check count in total",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 4,
"y": 36
},
"id": 56,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_success_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of Successful Health Check ",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 8,
"y": 36
},
"id": 58,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_fail_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of failed health check",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 12,
"y": 36
},
"id": 60,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_skip_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of skipped health check",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 16,
"y": 36
},
"id": 48,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_retry_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of retried health check",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 0,
"y": 41
},
"id": 50,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_max_retry_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of maximum retried health check",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 4,
"y": 41
},
"id": 54,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_average_retry_count{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Number of average retried health check",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "ms"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 8,
"y": 41
},
"id": 42,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_average_duration{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Average health check duration",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "ms"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 12,
"y": 41
},
"id": 46,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_min_duration{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Minimum health check duration",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisCenteredZero": false,
"axisColorMode": "text",
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 0,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "auto",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
},
{
"color": "red",
"value": 80
}
]
},
"unit": "ms"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 16,
"y": 41
},
"id": 44,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_health_check_stats_max_duration{hostname=~\"$backend_nodes\"}",
"legendFormat": "{{hostname}} ({{role}})",
"range": true,
"refId": "A"
}
],
"title": "Maximum health check duration",
"type": "timeseries"
},
{
"collapsed": false,
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 46
},
"id": 20,
"panels": [],
"title": "Query Cache",
"type": "row"
},
{
"datasource": {
"type": "prometheus",
"uid": "yf3j0hH4k"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 100,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green"
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 0,
"y": 47
},
"id": 62,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.2.1",
"targets": [
{
"datasource": "Prometheus",
"editorMode": "builder",
"expr": "udbc_unvdbcluster_cache_cache_hit_ratio",
"legendFormat": "{{instance}}",
"range": true,
"refId": "A"
}
],
"title": "Query Cache Hit Ratio",
"type": "gauge"
}
],
"refresh": false,
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": ".*",
"current": {
"selected": true,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "prometheus",
"uid": "yf3j0hH4k"
},
"definition": "label_values(udbc_unvdbcluster_nodes_status{}, hostname)",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "backend_nodes",
"options": [],
"query": {
"query": "label_values(udbc_unvdbcluster_nodes_status{}, hostname)",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
}
]
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "UDB-Cluster",
"uid": "KN5pOCn4g",
"version": 4,
"weekStart": ""
}
监控指标说明
| name | Description |
|---|---|
| udbc_frontend_total | Number of total child processes |
| udbc_frontend_used | Number of used child processes (可能会获取不到username等数据,将在下一版本中修复) |
| udbc_frontend_used_ratio | Ratio of used child processes to total child processes (0.0 to 1.0) |
| udbc_unvdbcluster_nodes_status | Backend node Status (1 for up or waiting, 0 for down or unused) |
| udbc_unvdbcluster_nodes_replication_delay | Replication delay |
| udbc_unvdbcluster_nodes_select_cnt | SELECT query counts issued to each backend |
| udbc_unvdbcluster_cache_cache_hit_ratio | Query cache hit ratio |
| udbc_unvdbcluster_cache_num_cache_entries | Number of used cache entries |
| udbc_unvdbcluster_cache_num_hash_entries | Number of total hash entries |
| udbc_unvdbcluster_cache_used_hash_entries | Number of used hash entries |
| udbc_unvdbcluster_backend_stats_select_cnt | SELECT statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_insert_cnt | INSERT statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_update_cnt | UPDATE statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_delete_cnt | DELETE statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_ddl_cnt | DDL statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_other_cnt | other statement counts issued to each backend |
| udbc_unvdbcluster_backend_stats_panic_cnt | Panic message counts returned from backend |
| udbc_unvdbcluster_backend_stats_fatal_cnt | Fatal message counts returned from backend |
| udbc_unvdbcluster_backend_stats_error_cnt | Error message counts returned from backend |
| udbc_unvdbcluster_health_check_stats_total_count | Number of health check count in total |
| udbc_unvdbcluster_health_check_stats_success_count | Number of successful health check count in total |
| udbc_unvdbcluster_health_check_stats_fail_count | Number of failed health check count in total |
| udbc_unvdbcluster_health_check_stats_skip_count | Number of skipped health check count in total |
| udbc_unvdbcluster_health_check_stats_retry_count | Number of retried health check count in total |
| udbc_unvdbcluster_health_check_stats_average_retry_count | Number of average retried health check count in a health check session |
| udbc_unvdbcluster_health_check_stats_max_retry_count | Number of maximum retried health check count in a health check session |
| udbc_unvdbcluster_health_check_stats_max_duration | Maximum health check duration in Millie seconds |
| udbc_unvdbcluster_health_check_stats_min_duration | Minimum health check duration in Millie seconds |
| udbc_unvdbcluster_health_check_stats_average_duration | Average health check duration in Millie seconds |