Added multoresource
This commit is contained in:
parent
ae5bcbc68a
commit
5bf662ce4c
2 changed files with 117 additions and 14 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"version": "1.3.0",
|
"version": "1.4.3",
|
||||||
"description": "Шаблон правил алертинга Grafana для PTAF",
|
"description": "Шаблон правил алертинга Grafana для PTAF",
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"no_data_state": "NoData",
|
"no_data_state": "NoData",
|
||||||
|
|
@ -531,5 +531,9 @@
|
||||||
"summary": "🔴 {{ $labels.instance }}: служба angie.service не активна"
|
"summary": "🔴 {{ $labels.instance }}: служба angie.service не активна"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"contact_point": {
|
||||||
|
"receiver_name": "Telegram PTAF Grafana",
|
||||||
|
"message_template": "{{ range .Alerts }}{{ if eq .Status \"firing\" }}🔴 *Firing*{{ else }}✅ *Resolved*{{ end }}\n{{ if .Annotations.summary }}{{ .Annotations.summary }}{{ end }}\n\n{{ if index .Values \"Значение\" }}*Текущее значение:* {{ index .Values \"Значение\" | printf \"%.2f\" }}\n{{ end }}\n*Labels:*\n{{ range .Labels.SortedPairs }} • {{ .Name }} = {{ .Value }}\n{{ end }}{{ end }}"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -48,14 +48,14 @@
|
||||||
"tenant_panels": [
|
"tenant_panels": [
|
||||||
{
|
{
|
||||||
"panel_key": "rps",
|
"panel_key": "rps",
|
||||||
"title_format": "RPS %s",
|
"title_format": "RPS {client}",
|
||||||
"width": 12,
|
"width": 12,
|
||||||
"x_offset": 0,
|
"x_offset": 0,
|
||||||
"y_offset": 1
|
"y_offset": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"panel_key": "status_codes",
|
"panel_key": "status_codes",
|
||||||
"title_format": "Status Codes %s",
|
"title_format": "Status Codes {client}",
|
||||||
"width": 12,
|
"width": 12,
|
||||||
"x_offset": 12,
|
"x_offset": 12,
|
||||||
"y_offset": 1
|
"y_offset": 1
|
||||||
|
|
@ -75,13 +75,6 @@
|
||||||
"width": 12,
|
"width": 12,
|
||||||
"x_offset": 12,
|
"x_offset": 12,
|
||||||
"y_offset": 9
|
"y_offset": 9
|
||||||
},
|
|
||||||
{
|
|
||||||
"panel_key": "traffic_combined",
|
|
||||||
"title_suffix": "{sid} Traffic",
|
|
||||||
"width": 24,
|
|
||||||
"x_offset": 0,
|
|
||||||
"y_offset": 17
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"overview_row_title": "Обзор",
|
"overview_row_title": "Обзор",
|
||||||
|
|
@ -110,6 +103,22 @@
|
||||||
"x_offset": 0,
|
"x_offset": 0,
|
||||||
"y_offset": 34
|
"y_offset": 34
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"inter_domain_panels": [
|
||||||
|
{
|
||||||
|
"panel_key": "traffic_combined_total",
|
||||||
|
"title_format": "Total Traffic {client}",
|
||||||
|
"condition": {
|
||||||
|
"type": "min_domains",
|
||||||
|
"value": 2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"traffic_domain_panels": [
|
||||||
|
{
|
||||||
|
"panel_key": "traffic_combined",
|
||||||
|
"title_format": "{domain} {sid} Traffic"
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"panels": {
|
"panels": {
|
||||||
|
|
@ -462,7 +471,7 @@
|
||||||
"metric": "sum",
|
"metric": "sum",
|
||||||
"field": "upstream_response_length_digital",
|
"field": "upstream_response_length_digital",
|
||||||
"ref_id": "A",
|
"ref_id": "A",
|
||||||
"expression": "$A / 60",
|
"expression": "$A * 8 / 1000 / 60",
|
||||||
"expression_ref_id": "ResponseTraffic"
|
"expression_ref_id": "ResponseTraffic"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -470,7 +479,7 @@
|
||||||
"metric": "sum",
|
"metric": "sum",
|
||||||
"field": "upstream_bytes_sent_digital",
|
"field": "upstream_bytes_sent_digital",
|
||||||
"ref_id": "B",
|
"ref_id": "B",
|
||||||
"expression": "$B / 60",
|
"expression": "$B * 8 / 1000 / 60",
|
||||||
"expression_ref_id": "RequestTraffic"
|
"expression_ref_id": "RequestTraffic"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
@ -507,7 +516,7 @@
|
||||||
"metric": "sum",
|
"metric": "sum",
|
||||||
"field": "upstream_response_length_digital",
|
"field": "upstream_response_length_digital",
|
||||||
"ref_id": "A",
|
"ref_id": "A",
|
||||||
"expression": "($A / 60)",
|
"expression": "($A * 8 / 1000 / 60)",
|
||||||
"expression_ref_id": "Traffic"
|
"expression_ref_id": "Traffic"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -1121,6 +1130,96 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"traffic_combined_total": {
|
||||||
|
"type": "timeseries",
|
||||||
|
"description": "Total Response and Request Traffic (all resources)",
|
||||||
|
"gridPos": {
|
||||||
|
"h": 8,
|
||||||
|
"w": 24,
|
||||||
|
"x": 0,
|
||||||
|
"y": 17
|
||||||
|
},
|
||||||
|
"fieldConfig": {
|
||||||
|
"defaults": {
|
||||||
|
"color": {
|
||||||
|
"mode": "palette-classic"
|
||||||
|
},
|
||||||
|
"custom": {
|
||||||
|
"drawStyle": "line",
|
||||||
|
"fillOpacity": 10,
|
||||||
|
"lineInterpolation": "smooth",
|
||||||
|
"lineWidth": 1,
|
||||||
|
"showPoints": "never",
|
||||||
|
"spanNulls": 180000
|
||||||
|
},
|
||||||
|
"unit": "Kbits"
|
||||||
|
},
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"matcher": {
|
||||||
|
"id": "byRegexp",
|
||||||
|
"options": "/.*Response.*/"
|
||||||
|
},
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": "color",
|
||||||
|
"value": {
|
||||||
|
"fixedColor": "green",
|
||||||
|
"mode": "fixed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"matcher": {
|
||||||
|
"id": "byRegexp",
|
||||||
|
"options": "/.*Request.*/"
|
||||||
|
},
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"id": "color",
|
||||||
|
"value": {
|
||||||
|
"fixedColor": "blue",
|
||||||
|
"mode": "fixed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"options": {
|
||||||
|
"legend": {
|
||||||
|
"displayMode": "list",
|
||||||
|
"placement": "bottom",
|
||||||
|
"showLegend": true
|
||||||
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"mode": "single"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"query_mode": "multi_sum_expression",
|
||||||
|
"query_config": {
|
||||||
|
"base_query": "SID:{sid}",
|
||||||
|
"targets": [
|
||||||
|
{
|
||||||
|
"alias": "Response Traffic",
|
||||||
|
"metric": "sum",
|
||||||
|
"field": "upstream_response_length_digital",
|
||||||
|
"ref_id": "A",
|
||||||
|
"expression": "$A * 8 / 1000 / 60",
|
||||||
|
"expression_ref_id": "ResponseTrafficTotal"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alias": "Request Traffic",
|
||||||
|
"metric": "sum",
|
||||||
|
"field": "upstream_bytes_sent_digital",
|
||||||
|
"ref_id": "B",
|
||||||
|
"expression": "$B * 8 / 1000 / 60",
|
||||||
|
"expression_ref_id": "RequestTrafficTotal"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"queries": {
|
"queries": {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue