Sending (parsed) response body in alert message #1107
Replies: 1 comment 1 reply
-
Dear @TwiN ! As you asked, I split the task into two parts. One part is to add wildcard support to the jsonparser in a backward compatible way, I made this, here it is: #1112 - Extend jsonpath package to support wildcards The other part is to modify the alert notifications. I made this half, please check out this version. It's not pretty, I know it would be nicer not to pass the result body as a parameter, but I don't know how to arrange them earlier (for example, a reference would be good, which Alert belongs to which Endpoint, but unfortunately I haven't reached this level in Go yet. I appreciate any guidance / ideas. Check this in my repo's branch: 5c95422 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: #850 - Add support for sending response body in alert message
Dirty "hack": #1105 - (feat) Add support for sending response body in alert message (with JSONPath support)
Dear @TwiN !
I'd like to correctly implement this feature. But I'm a beginner in Go. This is not a problem, I am willing to learn. I would like to discuss how to create this function. If I understand correctly, the endpoint should parse the HTTP response and store it for later use. This (Checksum) function will definitely need to be modified because the HTTP responses will be different, it will not be unique:
https://github.com/TwiN/gatus/blob/master/alerting/alert/alert.go#L110
In my opinion, the configuration setting value and the parsed body should be stored separately, and the latter should be used in alert providers. If I understood you: we should do the parse at Endpoint / Result level. OK, but how should I pass the configuration value (the JSON path). If we introduce a new setting here, we cannot override it at provider level. But this is not a big problem. Maybe a more correct way to implement:
Is this correct?
Beta Was this translation helpful? Give feedback.
All reactions