-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Rule component: Add a new API /api/v1/alerts/:state
for pull alerts from Thanos Rule
#901
Conversation
{ | ||
endpoint: api.stateAlerts, | ||
params: map[string]string{"state": "firing"}, | ||
response: &AlertDiscovery{Alerts: []*Alert{}}, |
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.
Could you add proper tests mock some firing alerts and check that they are returned currectly
How is this different from querying the |
change to 0.4.0 new func call
@wklken does Prometheus / alertmanager have a similiar api? Couldn't find this exact api. |
|
could you link me to that api? I couldn't find the |
https://github.com/prometheus/alertmanager/blob/master/api/v2/openapi.yaml#L130
In rule, |
I think we want to mimic Prometheus API, so I'm against introducing new API if it's not in Prometheus. Alertmanager is a different beast all together. Thoughts about this @bwplotka ? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
We want to use a
pull
monitoring system to replace thealertmanager
, which needs to fetch thefiring
alerts from Thanos Rule. So, after the rule apis added by this issue #851 from V0.3.2, we add one more API to fetch the alerts in specificstate
, likefiring
Changes
/api/v1/alerts/:state
Verification
BTW, while the
AlertingRule.active
is not public, it's difficult to mock theAlerts
and do the unittest here, still trying:)