Skip to content

Instantly share code, notes, and snippets.

@addozhang
Created November 27, 2021 06:15
Show Gist options
  • Save addozhang/44ecdbc4cfff345ddef8b26575cbe850 to your computer and use it in GitHub Desktop.
Save addozhang/44ecdbc4cfff345ddef8b26575cbe850 to your computer and use it in GitHub Desktop.
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- 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,
"gnetId": null,
"graphTooltip": 0,
"id": 7,
"iteration": 1637977099566,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 0,
"y": 0
},
"id": 27,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.2.5",
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n count() as `日志数`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace'\n\n",
"rawQuery": "SELECT\n count() as `日志数`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1627505082) AND toDateTime(reqTime/1000) <= toDateTime(1627548282) and pod.ns='flomesh-dubbo'",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"title": "时段日志总量",
"type": "stat"
},
{
"cacheTimeout": null,
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 20,
"x": 4,
"y": 0
},
"id": 15,
"interval": null,
"links": [],
"options": {
"legend": {
"displayMode": "list",
"placement": "right",
"values": [
"percent"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single"
}
},
"pluginVersion": "6.3.4",
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "timestamp",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n now(), res.status s,\n count()\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace'\n\nGROUP BY s\n\n\n",
"rawQuery": "SELECT\n now(), res.status s,\n count()\nFROM default.log\n\nWHERE timestamp >= toDateTime(1626939544) AND timestamp <= toDateTime(1627544344) and pod.ns='flomesh-dubbo'\n\nGROUP BY s",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "返回码分布",
"type": "piechart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 12,
"x": 0,
"y": 5
},
"id": 23,
"options": {
"legend": {
"displayMode": "list",
"placement": "right",
"values": [
"percent"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n now(), splitByChar('?',req.path)[1] as path,\n count()\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace' and res.status BETWEEN 400 and 499\n\nGROUP BY path",
"rawQuery": "SELECT\n now(), splitByChar('?',req.path)[1] as path,\n count()\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626940711) AND toDateTime(reqTime/1000) <= toDateTime(1627545511) and pod.ns='flomesh-dubbo' and res.status BETWEEN 400 and 499\n\nGROUP BY path",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"title": "4xx路径分布",
"type": "piechart"
},
{
"datasource": null,
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 12,
"x": 12,
"y": 5
},
"id": 25,
"options": {
"legend": {
"displayMode": "list",
"placement": "right",
"values": [
"percent"
]
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single"
}
},
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n now(), splitByChar('?',req.path)[1] as path,\n count()\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace' and res.status BETWEEN 500 and 599\n\nGROUP BY path",
"rawQuery": "SELECT\n now(), splitByChar('?',req.path)[1] as path,\n count()\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626942443) AND toDateTime(reqTime/1000) <= toDateTime(1627547243) and pod.ns='flomesh-dubbo' and res.status BETWEEN 500 and 599\n\nGROUP BY path",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"title": "5xx路径分布",
"type": "piechart"
},
{
"columns": [],
"datasource": "ClickHouse",
"fontSize": "100%",
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 10
},
"id": 19,
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": null,
"desc": false
},
"styles": [
{
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "date"
},
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "timestamp",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n toDateTime(reqTime/1000) as `时间`,\n (resTime - reqTime) as `延时`,\n req.path as `请求路径`\n FROM $table\nWHERE\n $timeFilter\n and pod.ns = '$namespace'\nORDER BY `延时` DESC\n\nLIMIT 100\n",
"rawQuery": "SELECT\n toDateTime(reqTime/1000) as `时间`,\n (resTime - reqTime) as `延时`,\n req.path as `请求路径`\n FROM default.log\nWHERE\n timestamp >= toDateTime(1627541433) AND timestamp <= toDateTime(1627543233)\n and pod.ns = 'flomesh-dubbo'\nORDER BY `延时` DESC\n\nLIMIT 100",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "Top100延时日志",
"transform": "table",
"type": "table-old"
},
{
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"displayMode": "auto"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 10
},
"id": 21,
"options": {
"showHeader": true
},
"pluginVersion": "8.2.5",
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "timestamp",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n toDateTime(reqTime/1000) as `时间`,\n (resSize + reqSize) as `大小`,\n req.path as `请求路径`\n FROM $table\nWHERE\n $timeFilter\n and pod.ns = '$namespace'\nORDER BY `大小` DESC\n\nLIMIT 100",
"rawQuery": "SELECT\n toDateTime(reqTime/1000) as `时间`,\n (resSize + reqSize) as `大小`,\n req.path as `请求路径`\n FROM default.log\nWHERE\n timestamp >= toDateTime(1627540206) AND timestamp <= toDateTime(1627626606)\n and pod.ns = 'default'\nORDER BY `大小` DESC\n\nLIMIT 100",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "Top100请求大小日志",
"type": "table"
},
{
"columns": [],
"datasource": "ClickHouse",
"fontSize": "100%",
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 18
},
"id": 9,
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "date"
},
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n toDateTime(reqTime/1000,'Asia/Shanghai') as `时间`,\n res.status as `返回码`,\n req.path as `请求路径`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace' and res.status BETWEEN 400 and 499\norder by `时间`\nlimit 100\n",
"rawQuery": "SELECT\n toDateTime(reqTime/1000,'Asia/Shanghai') as `时间`,\n res.status as `返回码`,\n req.path as `请求路径`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626938843) AND toDateTime(reqTime/1000) <= toDateTime(1627543643) and pod.ns='flomesh-dubbo' and res.status BETWEEN 400 and 499\norder by `时间`\nlimit 100",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "4xx错误日志",
"transform": "table",
"type": "table-old"
},
{
"columns": [],
"datasource": "ClickHouse",
"fontSize": "100%",
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 18
},
"id": 8,
"pageSize": null,
"scroll": true,
"showHeader": true,
"sort": {
"col": 0,
"desc": true
},
"styles": [
{
"alias": "Time",
"align": "auto",
"dateFormat": "YYYY-MM-DD HH:mm:ss",
"pattern": "Time",
"type": "date"
},
{
"alias": "",
"align": "auto",
"colorMode": null,
"colors": [
"rgba(245, 54, 54, 0.9)",
"rgba(237, 129, 40, 0.89)",
"rgba(50, 172, 45, 0.97)"
],
"decimals": 2,
"pattern": "/.*/",
"thresholds": [],
"type": "number",
"unit": "short"
}
],
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "table",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n toDateTime(reqTime/1000,'Asia/Shanghai') as `时间`,\n res.status as `返回码`,\n req.path as `访问路径`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace' and res.status BETWEEN 500 and 599\norder by `时间`\nlimit 100\n",
"rawQuery": "SELECT\n toDateTime(reqTime/1000,'Asia/Shanghai') as `时间`,\n res.status as `返回码`,\n req.path as `访问路径`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626938914) AND toDateTime(reqTime/1000) <= toDateTime(1627543714) and pod.ns='flomesh-dubbo' and res.status BETWEEN 500 and 599\norder by `时间`\nlimit 100",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"timeFrom": null,
"timeShift": null,
"title": "5xx错误日志",
"transform": "table",
"type": "table-old"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 26
},
"hiddenSeries": false,
"id": 11,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.2.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries as t,\n avg(resTime-reqTime) as `平均值`,\n max(resTime-reqTime) as `最大值`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace'\n\nGROUP BY t\n\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(toDateTime(reqTime/1000)), 600) * 600) * 1000 as t,\n avg(resTime-reqTime) as `平均值`,\n max(resTime-reqTime) as `最大值`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626938970) AND toDateTime(reqTime/1000) <= toDateTime(1627543770) and pod.ns='flomesh-dubbo'\n\nGROUP BY t\n\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "延时(毫秒)",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 26
},
"hiddenSeries": false,
"id": 13,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.2.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries as t,\n sum(reqSize+length(req.headers))/$interval as `请求`,\n sum(resSize+length(res.headers))/$interval as `响应`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace'\n\nGROUP BY t\n\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(toDateTime(reqTime/1000)), 600) * 600) * 1000 as t,\n sum(reqSize+length(req.headers))/600 as `请求`,\n sum(resSize+length(res.headers))/600 as `响应`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1627096354) AND toDateTime(reqTime/1000) <= toDateTime(1627701154) and pod.ns='flomesh-dubbo'\n\nGROUP BY t\n\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "带宽",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 34
},
"hiddenSeries": false,
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.2.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries as t,\n count()/$interval as `每秒请求数`\nFROM $table\n\nWHERE $timeFilter and pod.ns='$namespace'\n\nGROUP BY t\n\nORDER BY t\n",
"rawQuery": "SELECT\n (intDiv(toUInt32(toDateTime(reqTime/1000)), 600) * 600) * 1000 as t,\n count()/600 as `每秒请求数`\nFROM default.log\n\nWHERE toDateTime(reqTime/1000) >= toDateTime(1626939246) AND toDateTime(reqTime/1000) <= toDateTime(1627544046) and pod.ns='flomesh-dubbo'\n\nGROUP BY t\n\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "每秒请求数量",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"alert": {
"alertRuleTags": {},
"conditions": [
{
"evaluator": {
"params": [
0.1
],
"type": "gt"
},
"operator": {
"type": "and"
},
"query": {
"params": [
"A",
"5m",
"now"
]
},
"reducer": {
"params": [],
"type": "avg"
},
"type": "query"
}
],
"executionErrorState": "alerting",
"for": "5m",
"frequency": "1m",
"handler": 1,
"message": "5xx ratio alert",
"name": "4xx_5xx_ratio alert",
"noDataState": "no_data",
"notifications": [
{
"uid": "7ZcWO8Z7z"
}
]
},
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "ClickHouse",
"fieldConfig": {
"defaults": {
"links": []
},
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 34
},
"hiddenSeries": false,
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.2.5",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"database": "default",
"dateColDataType": "",
"dateLoading": false,
"dateTimeColDataType": "toDateTime(reqTime/1000)",
"dateTimeType": "DATETIME",
"datetimeLoading": false,
"extrapolate": true,
"format": "time_series",
"formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
"intervalFactor": 1,
"query": "SELECT\n $timeSeries as t,\n sum(case when res.status between 400 and 499 then 1 else 0 end) * 100 / count() as `4xx错误率`,\n sum(case when res.status between 500 and 599 then 1 else 0 end) * 100 / count() as `5xx错误率`\nFROM $table\n\nWHERE\n $timeFilter\n and pod.ns = '$namespace'\nGROUP BY t\n\nORDER BY t",
"rawQuery": "SELECT\n (intDiv(toUInt32(toDateTime(reqTime/1000)), 600) * 600) * 1000 as t,\n sum(case when res.status between 400 and 499 then 1 else 0 end) * 100 / count() as `4xx错误率`,\n sum(case when res.status between 500 and 599 then 1 else 0 end) * 100 / count() as `5xx错误率`\nFROM default.log\n\nWHERE\n toDateTime(reqTime/1000) >= toDateTime(1626939301) AND toDateTime(reqTime/1000) <= toDateTime(1627544101)\n and pod.ns = 'flomesh-dubbo'\nGROUP BY t\n\nORDER BY t",
"refId": "A",
"round": "0s",
"skip_comments": true,
"tableLoading": false
}
],
"thresholds": [
{
"colorMode": "critical",
"fill": true,
"line": true,
"op": "gt",
"value": 0.1,
"visible": true
}
],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "请求错误率%",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": false,
"schemaVersion": 32,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "ClickHouse",
"definition": "select distinct pod.ns from default.log where pod.ns !=''",
"description": null,
"error": {
"config": {
"headers": {
"X-Grafana-Org-Id": 1
},
"hideFromInspector": false,
"method": "GET",
"retry": 0,
"url": "api/datasources/proxy/20/?query=select%20distinct%20pod.ns%20from%20default.log%20where%20pod.ns%20!%3D''%20FORMAT%20JSON"
},
"data": {
"error": "",
"message": "",
"response": ""
},
"message": "Query error: 502 ",
"status": 502,
"statusText": ""
},
"hide": 0,
"includeAll": false,
"label": null,
"multi": false,
"name": "namespace",
"options": [],
"query": "select distinct pod.ns from default.log where pod.ns !=''",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tagsQuery": "",
"type": "query",
"useTags": false
},
{
"description": null,
"error": null,
"hide": 2,
"label": null,
"name": "table",
"query": "default.log",
"skipUrlSync": false,
"type": "constant"
}
]
},
"time": {
"from": "now-30m",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
]
},
"timezone": "",
"title": "Flomesh Access Log",
"uid": "AdXevuZ7k",
"version": 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment