Custom Assertions not working for Alerts #1360
o3webmaster
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have tried the given doc and examples in may ways (with all possible combinitions) but I could not generate two separate type of messages based on the assertion. Form the console logs it appears the actual / relevant assertion does get evaluated/executes but system is not able to analyze whether it need to send the alert or not and hence doesn't generate the alert.
However, if I have only one assertion (fulfilling all states) then it works and generates alert for the service when its state changes (Up, down). It also works if I do not have any details given in Alerts & assertion specified:
- id: 200-app-identity
name: Fusion Web Portal Login Service (Production)
interval: 10 # in seconds
requests:
- url: https://mysampledomain.com/api/v1/user
method: POST
body: {"payload":"{\"email\":\"[email protected]\"}"}
timeout: 5000 # in milliseconds
incidentThreshold: 3
recoveryThreshold: 3
alerts:
- assertion: response.status != 200 or response.time >=4000
message: '[💔] System/Service Unhealthy: Fusion Web Portal response received instead of 200 in {{ response.time }} time.'
- assertion: response.status == 200
message: '[👍] System/Service Restored: Fusion Web Portal login API has recovered and has been accessible for the past 50 seconds.'
This example only works once when launched with relevant alert message but later on it never intimates/alerts if the subjective service state changes (down / up).
Any idea why it is not working or what is going wrong. I also tried Alerts under 'requests' node but same behavior.
Beta Was this translation helpful? Give feedback.
All reactions