This repository was archived by the owner on Sep 30, 2024. It is now read-only.
chore/deps: upgrade alertmanager package dependency, improve logs and tests#63329
Merged
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @bobheadxi and the rest of your teammates on |
Base automatically changed from
chore-upgrade-alertmanager-prometheus-grpc
to
main
June 19, 2024 13:55
518dc61 to
eecafbe
Compare
1769a4f to
5d0d414
Compare
Strum355
approved these changes
Jun 19, 2024
unknwon
reviewed
Jun 19, 2024
| } | ||
| var buf bytes.Buffer | ||
| enc := expfmt.NewEncoder(&buf, expfmt.NewFormat(expfmt.TypeTextPlain)) | ||
| enc := expfmt.NewEncoder(&buf, expfmt.FmtText) |
Contributor
There was a problem hiding this comment.
Revert common version to continue using expfmt.FmtText would unsatisfy OpenFGA's requirement of common 💀
Member
Author
There was a problem hiding this comment.
Upgraded to the version declared by OpenFGA, v0.48.0 https://github.com/openfga/openfga/blob/77c666d5063c51216f7ffc0b6cc8a0e62957b241/go.mod#L106 - thankfully looks like this is still compatible, running some tests...
Member
Author
There was a problem hiding this comment.
Okay, I think this is good to go
Contributor
|
Caution License checking failed, please read: how to deal with third parties licensing. |
bobheadxi
referenced
this pull request
Jul 11, 2024
…#63790) The OTEL upgrade https://github.com/sourcegraph/sourcegraph/pull/63171 bumps the `prometheus/common` package too far via transitive deps, causing us to generate configuration for alertmanager that altertmanager doesn't accept, at least until the alertmanager project cuts a new release with a newer version of `promethues/common`. For now we forcibly downgrade with a replace. Everything still builds, so we should be good to go. ## Test plan `sg start` and `sg run prometheus`. On `main`, editing `observability.alerts` will cause Alertmanager to refuse to accept the generated configuration. With this patch, all is well it seems - config changes go through as expected. This is a similar test plan for https://github.com/sourcegraph/sourcegraph/pull/63329 ## Changelog - Fix Prometheus Alertmanager configuration failing to apply `observability.alerts` from site config
sourcegraph-release-bot
referenced
this pull request
Jul 11, 2024
…#63790) The OTEL upgrade https://github.com/sourcegraph/sourcegraph/pull/63171 bumps the `prometheus/common` package too far via transitive deps, causing us to generate configuration for alertmanager that altertmanager doesn't accept, at least until the alertmanager project cuts a new release with a newer version of `promethues/common`. For now we forcibly downgrade with a replace. Everything still builds, so we should be good to go. ## Test plan `sg start` and `sg run prometheus`. On `main`, editing `observability.alerts` will cause Alertmanager to refuse to accept the generated configuration. With this patch, all is well it seems - config changes go through as expected. This is a similar test plan for https://github.com/sourcegraph/sourcegraph/pull/63329 ## Changelog - Fix Prometheus Alertmanager configuration failing to apply `observability.alerts` from site config (cherry picked from commit ffa873f)
jdpleiness
referenced
this pull request
Jul 11, 2024
… generated config (#63793) The OTEL upgrade https://github.com/sourcegraph/sourcegraph/pull/63171 bumps the `prometheus/common` package too far via transitive deps, causing us to generate configuration for alertmanager that altertmanager doesn't accept, at least until the alertmanager project cuts a new release with a newer version of `promethues/common`. For now we forcibly downgrade with a replace. Everything still builds, so we should be good to go. ## Test plan `sg start` and `sg run prometheus`. On `main`, editing `observability.alerts` will cause Alertmanager to refuse to accept the generated configuration. With this patch, all is well it seems - config changes go through as expected. This is a similar test plan for https://github.com/sourcegraph/sourcegraph/pull/63329 ## Changelog - Fix Prometheus Alertmanager configuration failing to apply `observability.alerts` from site config <br> Backport ffa873f from #63790 Co-authored-by: Robert Lin <robert@bobheadxi.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Upgrades to our forked update v0.27.0, which matches the Alertmanager version we deploy: sourcegraph/alertmanager@3695ef8. Upon closer inspection I also realized I upgraded
prometheus/commontoo far in https://github.com/sourcegraph/sourcegraph/pull/63328 - I've downgraded it to match the revision of Alertmanager we are using, while also fulfilling the OpenFGA dependency https://github.com/sourcegraph/sourcegraph/pull/63329#discussion_r1646630946 for https://github.com/sourcegraph/sourcegraph/pull/63173 💀The latest version of
prometheus/commonmarshals configuration values that are unknown to our version of Alertmanager (v0.27.0) which rejects the generated configuration fromprom-wrapper.I've also made a few updates to improve the testing and improve the prometheus and alertmanager output by forwarding them to differently-scoped loggers and crude conversion of the log levels:
Related: https://github.com/sourcegraph/sourcegraph/pull/63171
Closes CORE-186
Test plan
sg startandsg run prometheus, update some alerting configs in http://localhost:9090/alertmanager/#/status:In personal settings:
{ "alerts.hideObservabilitySiteAlerts": false }No banners show up indicating Prometheus is unhealthy.