Add http status code check to alert rule
All checks were successful
Lint Checks / Run linter (pull_request) Successful in 39s
Deploy Test / Run deploy test suite (pull_request) Successful in 5m0s
Webapp Test / Run webapp test suite (pull_request) Successful in 5m45s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Successful in 9m27s
Smoke Test / Run basic test suite (pull_request) Successful in 5m0s

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
range: false
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
relativeTimeRange:
from: 600
@ -48,7 +62,7 @@ groups:
name: Expression
type: __expr__
uid: __expr__
expression: ${probe} != 1
expression: ${probe} != 1 || ${http_status_code} != 200
intervalMs: 1000
maxDataPoints: 43200
refId: condition
@ -57,9 +71,8 @@ groups:
execErrState: Alerting
for: 5m
annotations:
summary: Probe failed for Azimuth gateway endpoint {{ index $labels "instance" }}
summary: Probe failed for Azimuth gateway endpoint
labels:
endpoint: '{{ index $labels "instance" }}'
probe_success: '{{ index $values "probe" }}'
isPaused: false
# Laconicd GQL endpoint
@ -81,6 +94,20 @@ groups:
maxDataPoints: 43200
range: false
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
relativeTimeRange:
from: 600
@ -105,7 +132,7 @@ groups:
name: Expression
type: __expr__
uid: __expr__
expression: ${probe} != 1
expression: ${probe} != 1 || ${http_status_code} != 200
intervalMs: 1000
maxDataPoints: 43200
refId: condition
@ -114,8 +141,7 @@ groups:
execErrState: Alerting
for: 5m
annotations:
summary: Probe failed for Laconicd GQL endpoint {{ index $labels "instance" }}
summary: Probe failed for Laconicd GQL endpoint
labels:
endpoint: '{{ index $labels "instance" }}'
probe_success: '{{ index $values "probe" }}'
isPaused: false