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>
pracucci
left a comment
There was a problem hiding this comment.
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
pracucci
left a comment
There was a problem hiding this comment.
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.
What would combining mean in terms of behavior?
There was a problem hiding this comment.
Combining would deduplicate the results from those alertmanagers, basically a union
7ce76cf to
e43d915
Compare
Signed-off-by: Ganesh Vernekar <cs15btech11018@iith.ac.in>
e43d915 to
92657d3
Compare
|
|
||
| // 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.
| // DistributeRequest assumes that the caller has verified IsPathSupported return | |
| // DistributeRequest assumes that the caller has verified IsPathSupported returns |
pstibrany
left a comment
There was a problem hiding this comment.
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.
To make sure we don't panic in rand.Intn, we should verify that len(replicationSet) > 0.
There was a problem hiding this comment.
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
pracucci
left a comment
There was a problem hiding this comment.
Still LGTM. Time to merge it!
What this PR does:
Adds sharding capabilities to alertmanager for the
/alertsAPI and introduces a new Distributor component in it based on the design here.Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]