监控告警配置
监控告警配置
推荐使用 Prometheus (opens new window) 作为监控和性能指标信息存储方案,使用 Grafana (opens new window) 作为可视化组件进行展示。
Prometheus 配置
- 在 Prometheus 配置的 scrape_configs 中添加如下 job:
如果 Zadig 和 Prometheus 在同一集群中
job_name: prometheus
metrics_path: /api/metrics
static_configs:
- targets:
- aslan.<部署 namespace>.svc:25000
如果 Zadig 和 Prometheus 在不同集群中
job_name: admin
metrics_path: /api/aslan/metrics
static_configs:
- targets:
- <Zadig的访问域名>
scheme: https
- 重新加载 Prometheus 配置
- 在 Prometheus 的 query 界面,输入 request_total 进行查询,确认有数据,证明配置成功
Grafana 配置
Dashboard 配置
- [可选项]在 Grafana 的 configuration - Data source 中配置上文的 Prometheus 为数据源
- 在 dashboards - import 中输入如下 JSON 导入 Grafana 面板
{
"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": 3,
"links": [],
"liveNow": false,
"panels": [
{
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 6,
"x": 0,
"y": 0
},
"id": 4,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"editorMode": "code",
"expr": "running_workflows",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "运行中的工作流",
"type": "gauge"
},
{
"description": "",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 6,
"x": 6,
"y": 0
},
"id": 6,
"options": {
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showThresholdLabels": false,
"showThresholdMarkers": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"editorMode": "code",
"expr": "pending_workflows",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "排队中的工作流",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"max": 1,
"min": 0,
"noValue": "0",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 0
},
"id": 20,
"options": {
"displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "auto",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "",
"values": false
},
"showUnfilled": true
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "healthy{service=~\"aslan|dind|hub-server|plutus-vendor|user|zadig-portal\"}",
"format": "time_series",
"instant": true,
"legendFormat": "{{service}}",
"range": false,
"refId": "A"
}
],
"title": "服务健康状态",
"type": "bargauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"viz": false
}
},
"mappings": [],
"max": -1,
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "正常"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "green",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "异常"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "等待接入"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "blue",
"mode": "fixed"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "断开连接"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "yellow",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 9
},
"id": 22,
"options": {
"displayLabels": [],
"legend": {
"displayMode": "list",
"placement": "right",
"showLegend": true,
"values": []
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"last"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "count(cluster) == 0",
"instant": true,
"legendFormat": "异常",
"range": false,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "count(cluster == 1)",
"hide": false,
"instant": true,
"legendFormat": "等待接入",
"range": false,
"refId": "B"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "count(cluster == 2)",
"hide": false,
"instant": true,
"legendFormat": "断开连接",
"range": false,
"refId": "C"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "count(cluster == 3)",
"hide": false,
"instant": true,
"legendFormat": "正常",
"range": false,
"refId": "D"
}
],
"title": "集群状态",
"type": "piechart"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"fillOpacity": 70,
"lineWidth": 1
},
"decimals": 0,
"mappings": [
{
"options": {
"0": {
"color": "red",
"index": 3,
"text": "异常"
},
"1": {
"color": "blue",
"index": 2,
"text": "等待接入"
},
"2": {
"color": "yellow",
"index": 1,
"text": "断开连接"
},
"3": {
"color": "green",
"index": 0,
"text": "正常"
}
},
"type": "value"
}
],
"max": 3,
"min": 0,
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 9
},
"id": 24,
"options": {
"colWidth": 0.9,
"legend": {
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"rowHeight": 0.9,
"showValue": "never",
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"pluginVersion": "9.4.7",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"exemplar": false,
"expr": "cluster",
"instant": false,
"interval": "",
"legendFormat": "{{cluster}}",
"range": true,
"refId": "A"
}
],
"title": "集群状态详情",
"type": "status-history"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"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": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 18
},
"id": 16,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"expr": "cpu_percentage",
"legendFormat": "{{service}}",
"range": true,
"refId": "A"
}
],
"title": "CPU占用百分比",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"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": "percentage",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 18
},
"id": 18,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"editorMode": "builder",
"expr": "memory_percentage",
"legendFormat": "{{service}}",
"range": true,
"refId": "A"
}
],
"title": "内存占用百分比",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"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": 12,
"x": 0,
"y": 26
},
"id": 8,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"editorMode": "code",
"expr": "cpu",
"legendFormat": "{{service}}",
"range": true,
"refId": "A"
}
],
"title": "CPU 消耗",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "6JQZS4L4z"
},
"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": 12,
"x": 12,
"y": 26
},
"id": 10,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"editorMode": "code",
"expr": "memory",
"legendFormat": "{{service}}",
"range": true,
"refId": "A"
}
],
"title": "内存消耗(MB)",
"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": 3,
"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": 9,
"w": 12,
"x": 0,
"y": 34
},
"id": 2,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "right",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"editorMode": "code",
"exemplar": false,
"expr": "sum by(instance) (rate(request_total{status=\"200\"}[1m]))",
"format": "time_series",
"hide": false,
"instant": false,
"interval": "",
"legendFormat": "200",
"range": true,
"refId": "A"
},
{
"editorMode": "code",
"expr": "sum by(instance) (rate(request_total{status=~\"4..\"}[1m]))",
"hide": false,
"legendFormat": "4xx",
"range": true,
"refId": "B"
},
{
"editorMode": "code",
"expr": "sum by(instance) (rate(request_total{status=\"5..\"}[1m]))",
"hide": false,
"legendFormat": "5xx",
"range": true,
"refId": "C"
}
],
"title": "QPS追踪",
"type": "timeseries"
},
{
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": "auto",
"cellOptions": {
"type": "auto"
},
"inspect": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "慢接口"
},
"properties": [
{
"id": "custom.width",
"value": 1301
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 34
},
"id": 12,
"options": {
"footer": {
"countRows": false,
"fields": "",
"reducer": [
"sum"
],
"show": false
},
"frameIndex": 0,
"showHeader": true,
"sortBy": []
},
"pluginVersion": "9.4.7",
"targets": [
{
"editorMode": "code",
"exemplar": false,
"expr": "topk(10, sum by(method, handler) (api_response_time_bucket{status=\"200\",le=\"+Inf\"}) - sum by(method, handler) (api_response_time_bucket{status=\"200\",le=\"1.4\"}))",
"format": "time_series",
"hide": false,
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "慢接口列表",
"transformations": [
{
"id": "reduce",
"options": {
"includeTimeField": false,
"labelsToFields": false,
"mode": "seriesToRows",
"reducers": [
"last"
]
}
},
{
"id": "sortBy",
"options": {
"fields": {},
"sort": [
{
"desc": true,
"field": "Last"
}
]
}
},
{
"id": "organize",
"options": {
"excludeByName": {},
"indexByName": {},
"renameByName": {
"Field": "慢接口",
"Last": "请求数量"
}
}
}
],
"type": "table"
}
],
"refresh": "5s",
"revision": 1,
"schemaVersion": 38,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-5m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Zadig 监控面板",
"uid": "w1U8k1xVkfew",
"version": 26,
"weekStart": ""
}
- 在面板列表中找到 Zadig 监控面板, 确认数据正常展示。
告警规则配置
- 导入告警规则,导入方法可参考 grafana 文档 (opens new window)。
apiVersion: 1
groups:
- orgId: 1
name: zadig
folder: koderover
interval: 10s
rules:
- uid: 4ugWsnEIk
title: CPU占用百分比
condition: C
data:
- refId: A
relativeTimeRange:
from: 300
to: 0
datasourceUid: 6JQZS4L4z
model:
datasource:
type: prometheus
uid: 6JQZS4L4z
editorMode: builder
expr: cpu_percentage{service=~"aslan|user|cron|dind|plutus-vendor|hub-server"}
interval: ""
intervalMs: 15000
legendFormat: "{{service}}"
maxDataPoints: 43200
range: true
refId: A
- refId: B
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: mean
refId: B
type: reduce
- refId: C
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0.8
type: gt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: B
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
dashboardUid: w1U8k1xVkfew
panelId: 16
noDataState: NoData
execErrState: Error
for: 5m
annotations:
__dashboardUid__: w1U8k1xVkfew
__panelId__: "16"
isPaused: false
- uid: YIcGs7ESz
title: 内存占用百分比
condition: C
data:
- refId: A
relativeTimeRange:
from: 300
to: 0
datasourceUid: 6JQZS4L4z
model:
datasource:
type: prometheus
uid: 6JQZS4L4z
editorMode: builder
expr: memory_percentage{service=~"aslan|user|cron|hub-server|plutus-vendor|dind"}
interval: ""
intervalMs: 15000
legendFormat: "{{service}}"
maxDataPoints: 43200
range: true
refId: A
- refId: B
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: mean
refId: B
type: reduce
- refId: C
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0.8
type: gt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: B
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
dashboardUid: w1U8k1xVkfew
panelId: 18
noDataState: NoData
execErrState: Error
for: 5m
annotations:
__dashboardUid__: w1U8k1xVkfew
__panelId__: "18"
isPaused: false
- uid: RCovy7PIk
title: 服务健康状态
condition: C
data:
- refId: A
relativeTimeRange:
from: 10
to: 0
datasourceUid: 6JQZS4L4z
model:
editorMode: builder
expr: healthy{service=~"aslan|dind|plutus-vendor|user|zadig-portal|hub-server"}
hide: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: B
relativeTimeRange:
from: 10
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: last
refId: B
type: reduce
- refId: C
relativeTimeRange:
from: 10
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 1
type: lt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: B
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
noDataState: NoData
execErrState: Error
for: 10s
isPaused: false
- uid: h6yZC8yIz
title: 状态码5xx告警
condition: C
data:
- refId: A
relativeTimeRange:
from: 300
to: 0
datasourceUid: 6JQZS4L4z
model:
editorMode: builder
expr: sum(api_response_time_bucket{status=~"5..", le="300"})
hide: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: B
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: avg
type: query
datasource:
name: Expression
type: __expr__
uid: __expr__
expression: A
intervalMs: 1000
maxDataPoints: 43200
reducer: mean
refId: B
settings:
mode: ""
type: reduce
- refId: C
relativeTimeRange:
from: 300
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 10
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: avg
type: query
datasource:
name: Expression
type: __expr__
uid: __expr__
expression: B
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
noDataState: NoData
execErrState: Error
for: 5m
isPaused: false
- uid: fA_BZusIz
title: 请求返回时间P95
condition: C
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: 6JQZS4L4z
model:
editorMode: builder
expr: histogram_quantile(0.95, sum by(le) (increase(api_response_time_bucket[5m])))
hide: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: B
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: avg
type: query
datasource:
name: Expression
type: __expr__
uid: __expr__
expression: A
intervalMs: 1000
maxDataPoints: 43200
reducer: mean
refId: B
type: reduce
- refId: C
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 2
- 0
type: gt
operator:
type: and
query:
params: []
reducer:
params: []
type: avg
type: query
datasource:
name: Expression
type: __expr__
uid: __expr__
expression: B
intervalMs: 1000
maxDataPoints: 43200
refId: C
type: threshold
noDataState: NoData
execErrState: Error
for: 5m
isPaused: false
- 在告警规则列表中找到 Zadig 的告警规则, 确认数据正常。