-
Notifications
You must be signed in to change notification settings - Fork 816
Vendor prometheus 2.12.0 and alertmanager 0.19.0 #1597
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
Conversation
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
The |
Signed-off-by: Ganesh Vernekar <[email protected]>
b5a0203
to
e016238
Compare
With the last commit I believe I fixed all alertmanager API changes. But now alertmanager 0.18.0 uses an older version of prometheus/common (0.4.1), and is not compatible with the latest (0.6.0) which the prometheus pulls. It is fixed in alertmanager master, but vendoring that is downgrading prometheus unusually. |
Opened this PR prometheus/alertmanager#2008 to fix the prometheus downgrade. |
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 function to register the routes needs to be changed, otherwise this looks good to me.
pkg/alertmanager/alertmanager.go
Outdated
|
||
am.router = route.New() | ||
|
||
webReload := make(chan chan error) | ||
ui.Register(am.router.WithPrefix(am.cfg.ExternalURL.Path), webReload, log.With(am.logger, "component", "ui")) | ||
am.api.Register(am.router.WithPrefix(path.Join(am.cfg.ExternalURL.Path, "/api/v1"))) | ||
am.api.Register(am.router, path.Join(am.cfg.ExternalURL.Path, "/api/v1")) |
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.
This Register
will handle registering the correct api prefix, no need to pass this.
am.api.Register(am.router, path.Join(am.cfg.ExternalURL.Path, "/api/v1")) | |
am.api.Register(am.router, am.cfg.ExternalURL.Path) |
|
||
// buildReceiverIntegrations builds a list of integration notifiers off of a | ||
// receiver config. | ||
// Taken from https://github.com/prometheus/alertmanager/blob/94d875f1227b29abece661db1a68c001122d1da5/cmd/alertmanager/main.go#L112-L159. |
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.
We should look into exporting this upstream function if we can.
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.
Looking at old alertmanager releases, it was actually exported in some different package. It was un-exported and moved there in recent releases. I will attempt exporting 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.
Tried to export it in upstream by putting it in the right place (alertmanager/notify
), but running into a lot of cyclic import conflicts (tried to remove most, but hit a dead-end to fix it without duplicating some code). If its fine we could leave it as it is here.
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
ea93970
to
0934e8e
Compare
This PR is ready for another review now. I have vendored prometheus 2.12.0 and alertmanager 0.19.0-rc.0 (will do 0.19.0 in this PR when it's out but I don't expect it to be different), and finally no conflicts with prometheus 2.12.0! |
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Updated alertmanager to 0.19.0 (no changes from rc0) and addressed all reviews. Waiting to cut 0.2 I believe. |
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
Signed-off-by: Ganesh Vernekar <[email protected]>
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.
Dropping -alertmanager.configs.auto-slack-root
needs to go in CHANGELOG as a breaking change.
Also I would list this update to 2.12.0 / 0.19.0 in CHANGELOG as it will be of interest to consumers.
@bboreham Done |
Signed-off-by: Ganesh Vernekar <[email protected]>
06b89b8
to
0200fa1
Compare
Was it essential here to update jsoniter ? |
Did not really see into that and did not expect the bugs that it's causing. Sorry about that! I see @gouthamve already has some advancements on this prometheus/prometheus#6030 |
With this, we no longer vendor prometheus/tsdb repo as it was merged with prometheus.
prometheus/alertmanager is also upgraded to 0.18.0 as a part of this. I have managed to fix all the API changes except 1, still trying to figure out what has to be done for that.