-
Notifications
You must be signed in to change notification settings - Fork 812
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
Alertmanager Distributor #3671
Alertmanager Distributor #3671
Conversation
Depends on #3664 |
de1bc94
to
5f303ca
Compare
44306db
to
9852490
Compare
#3664 is now merged, feel free to rebase. |
9852490
to
f85ca18
Compare
I have rebased, but I need to fix some TODOs, add some metrics and more tests. I will tell when it is ready for review. |
f85ca18
to
85d1f5f
Compare
It is ready for a review. I still have to fix the metrics part of unit test and have to test running the distributor and alertmanager in a single binary to see if routing is happening properly (with no conflicting route registrations). |
85d1f5f
to
dc746c9
Compare
4f0bf13
to
e5cd2b3
Compare
PR is ready for review. I am still testing some bits locally to make sure everything is working fine. I will be adding more tests to alertmanager. The current idea is to handle sharding only for |
4088bc7
to
c2eaed2
Compare
c2eaed2
to
bbbedab
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
1bb7349
to
2159ef5
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2159ef5
to
f414266
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
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.
Thanks a lot for addressing all comments. Change LGTM and most of the left comments are last nit, but there are a couple of serious ones reason why I haven't marked as approved yet. Thanks!
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
27ad663
to
0ae3b27
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
0ae3b27
to
1b4ee91
Compare
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.
Good job, LGTM. Thanks! (just left few minor nits)
|
||
sp, ctx := opentracing.StartSpanFromContext(r.Context(), "Distribute.doRead") | ||
defer sp.Finish() | ||
// Until we have a mechanism to combine the results from multiple alertmanagers, |
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.
What would combining mean in terms of behavior?
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.
Combining would deduplicate the results from those alertmanagers, basically a union
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.
LGTM
7ce76cf
to
e43d915
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
e43d915
to
92657d3
Compare
pkg/alertmanager/distributor.go
Outdated
|
||
// DistributeRequest shards the writes and returns as soon as the quorum is satisfied. | ||
// In case of reads, it proxies the request to one of the alertmanagers. | ||
// DistributeRequest assumes that the caller has verified IsPathSupported return |
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.
// DistributeRequest assumes that the caller has verified IsPathSupported return | |
// DistributeRequest assumes that the caller has verified IsPathSupported returns |
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.
Great job, this looks good! I've left some last comments.
defer sp.Finish() | ||
// Until we have a mechanism to combine the results from multiple alertmanagers, | ||
// we forward the request to only only of the alertmanagers. | ||
amDesc := replicationSet.Ingesters[rand.Intn(len(replicationSet.Ingesters))] |
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.
To make sure we don't panic in rand.Intn
, we should verify that len(replicationSet) > 0
.
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.
The strategy used for AM ring makes sure there is at least 1 AM, so do we need the check here?
44bbf73
to
2f4e05c
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
2f4e05c
to
6a39e95
Compare
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.
Still LGTM. Time to merge it!
What this PR does:
Adds sharding capabilities to alertmanager for the
/alerts
API and introduces a new Distributor component in it based on the design here.Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]