Add http status code check to alert rule

This commit is contained in:
Prathamesh Musale 2024-04-15 18:42:26 +05:30
parent 23d527720f
commit abf4d39a22

View File

@ -24,6 +24,20 @@ groups:
maxDataPoints: 43200 maxDataPoints: 43200
range: false range: false
refId: probe refId: probe
- refId: http_status_code
relativeTimeRange:
from: 600
to: 0
datasourceUid: PBFA97CFB590B2093
model:
editorMode: code
expr: probe_http_status_code{destination="azimuth_gateway"}
instant: true
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: false
refId: http_status_code
- refId: condition - refId: condition
relativeTimeRange: relativeTimeRange:
from: 600 from: 600
@ -48,7 +62,7 @@ groups:
name: Expression name: Expression
type: __expr__ type: __expr__
uid: __expr__ uid: __expr__
expression: ${probe} != 1 expression: ${probe} != 1 || ${http_status_code} != 200
intervalMs: 1000 intervalMs: 1000
maxDataPoints: 43200 maxDataPoints: 43200
refId: condition refId: condition
@ -57,9 +71,8 @@ groups:
execErrState: Alerting execErrState: Alerting
for: 5m for: 5m
annotations: annotations:
summary: Probe failed for Azimuth gateway endpoint {{ index $labels "instance" }} summary: Probe failed for Azimuth gateway endpoint
labels: labels:
endpoint: '{{ index $labels "instance" }}'
probe_success: '{{ index $values "probe" }}' probe_success: '{{ index $values "probe" }}'
isPaused: false isPaused: false
# Laconicd GQL endpoint # Laconicd GQL endpoint
@ -81,6 +94,20 @@ groups:
maxDataPoints: 43200 maxDataPoints: 43200
range: false range: false
refId: probe refId: probe
- refId: http_status_code
relativeTimeRange:
from: 600
to: 0
datasourceUid: PBFA97CFB590B2093
model:
editorMode: code
expr: probe_http_status_code{destination="laconicd_gql"}
instant: true
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: false
refId: http_status_code
- refId: condition - refId: condition
relativeTimeRange: relativeTimeRange:
from: 600 from: 600
@ -105,7 +132,7 @@ groups:
name: Expression name: Expression
type: __expr__ type: __expr__
uid: __expr__ uid: __expr__
expression: ${probe} != 1 expression: ${probe} != 1 || ${http_status_code} != 200
intervalMs: 1000 intervalMs: 1000
maxDataPoints: 43200 maxDataPoints: 43200
refId: condition refId: condition
@ -114,8 +141,7 @@ groups:
execErrState: Alerting execErrState: Alerting
for: 5m for: 5m
annotations: annotations:
summary: Probe failed for Laconicd GQL endpoint {{ index $labels "instance" }} summary: Probe failed for Laconicd GQL endpoint
labels: labels:
endpoint: '{{ index $labels "instance" }}'
probe_success: '{{ index $values "probe" }}' probe_success: '{{ index $values "probe" }}'
isPaused: false isPaused: false