Skip to content

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

Merged
merged 13 commits into from
Sep 9, 2019

Conversation

codesome
Copy link
Contributor

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.

Ganesh Vernekar added 4 commits August 21, 2019 20:17
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome
Copy link
Contributor Author

The conf.Receivers here needs a fix still.

@codesome
Copy link
Contributor Author

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.

@codesome
Copy link
Contributor Author

Opened this PR prometheus/alertmanager#2008 to fix the prometheus downgrade.

Copy link
Contributor

@jtlisi jtlisi left a 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.


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"))
Copy link
Contributor

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.

Suggested change
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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Ganesh Vernekar added 2 commits August 26, 2019 11:58
@codesome codesome changed the title Vendor prometheus 2.12.0 Vendor prometheus 2.12.0 and alertmanager 0.19.0 Sep 3, 2019
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome
Copy link
Contributor Author

codesome commented Sep 3, 2019

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!

Ganesh Vernekar added 3 commits September 3, 2019 21:50
Signed-off-by: Ganesh Vernekar <[email protected]>
Signed-off-by: Ganesh Vernekar <[email protected]>
@codesome
Copy link
Contributor Author

codesome commented Sep 3, 2019

Updated alertmanager to 0.19.0 (no changes from rc0) and addressed all reviews. Waiting to cut 0.2 I believe.

Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

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

LGTM

@codesome codesome mentioned this pull request Sep 4, 2019
Copy link
Contributor

@bboreham bboreham left a 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.

@codesome
Copy link
Contributor Author

codesome commented Sep 5, 2019

@bboreham Done

Signed-off-by: Ganesh Vernekar <[email protected]>
@bboreham bboreham merged commit 9e5dedc into cortexproject:master Sep 9, 2019
@bboreham
Copy link
Contributor

Was it essential here to update jsoniter ?

@codesome
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants