New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alerting: Implement /status for the notification system #33227
Conversation
Implements the necessary plumbing to have a /status endpoint on the notification system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got the impression that we wanted to modify only RouteGetAlertingConfig and handle the 404 responses and in that case to get the default configuration from the /alertmanager/api/v2/status
(given that GET /api/alertmanager/{Recipient}/config/api/v1/alerts for grafana returns the default configuration if it does not exist)
but I'm fine also having a distinct endpoint for that.
@domasx2 can you test this branch to make sure it matches your expectations? |
on it |
Could we have backend unmarshal |
Looks from here, @domasx2 can have the final call on when to merge this if you have addressed his comments. |
Heya, tested! It seems From this endpoint:
config directly from alertmanager:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment :)
good catch! I didn't noticed it |
I have fixed |
Dunno, if there's no semantic difference for alertmanager, works for me. Couldn't we just convert yaml to json without going through intermediate structs and all these problems though? |
I don't think there is an easy way to do so and I believe that such a conversion most probably would also suffer from the same issues (because it would follow the same JSON semantics) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested more, lgtm 👍 preparing a frontend PR for it
relevant frontend changes: #35769 |
Implements the necessary plumbing to have a /status endpoint on the
notification system.
Updated
Unmarshalling the cloud request used to fail with: no routes provided
because the response from the cloud returns the alertmanager configuration as string where there is no
Route
define:therefore I have changed it so that also the grafana backend fork returns the configuration as string.Therefore, I have implemented GettableStatus.UnmarshalJSON() that unmarshals
config.original
field from YAML and returns the same struct with grafana backend fork.This fix requires prometheus/common#303 and/or prometheus/alertmanager#2607
Example requests: