Skip to content

Add minimal support for missing routes in alertmanager distributor. #4084

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

Merged
merged 5 commits into from
Apr 16, 2021

Conversation

stevesg
Copy link
Contributor

@stevesg stevesg commented Apr 16, 2021

What this PR does:
Add and test the following routes to the alertmanager distributor (in use only when sharding is enabled):

  • POST /alertmanager/api/v1/silences
  • GET /alertmanager/api/v1/silences
  • GET /alertmanager/api/v1/silence/{id}
  • DELETE /alertmanager/api/v1/silence/{id}
  • GET /alertmanager/api/v1/status
  • POST /alertmanager/api/v1/receivers

All requests are simply forwarded to a single randomly chosen replica
of the shard which contains the user.

Note I've had to incorporate the fix from #4083 in this PR. Rebased.

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@stevesg stevesg marked this pull request as draft April 16, 2021 07:44
@stevesg
Copy link
Contributor Author

stevesg commented Apr 16, 2021

Draft while I fix the tests.

stevesg added 3 commits April 16, 2021 09:48
Add and test the following routes:
- `POST   /alertmanager/api/v1/silences`
- `GET    /alertmanager/api/v1/silences`
- `GET    /alertmanager/api/v1/silence/{id}`
- `DELETE /alertmanager/api/v1/silence/{id}`
- `GET    /alertmanager/api/v1/status`
- `POST   /alertmanager/api/v1/receivers`

All requests are simply forwarded to a single randomly chosen replica
which is assigned for the shard which contains the user.

Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice tests! Thanks.

@stevesg stevesg marked this pull request as ready for review April 16, 2021 08:56
Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid work, congrats! No comments, LGTM! 👏

Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
@pracucci pracucci merged commit 97799e7 into cortexproject:master Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants