feat(cluster): persistant peer names#4636
Merged
SuperQ merged 1 commit intoprometheus:mainfrom Oct 28, 2025
Merged
Conversation
Contributor
|
Maybe add at least one testcase in cluster/cluster_test.go that does pass something else then "" as name arg into Create() ? |
016908b to
3c8cc0a
Compare
3c8cc0a to
c69793b
Compare
Contributor
Author
Updated, |
c69793b to
6b4f5b0
Compare
SuperQ
requested changes
Oct 28, 2025
6b4f5b0 to
4c50924
Compare
648aed4 to
714f25d
Compare
Currently the default behaviour is to generate a new, random peer name on every startup. It might be desired to have a persistent peer name in consistent setups like running the cluster on bare-metal nodes. This change adds an optional cli arg that allows specifying a custom peer name. If no peer name is specified a random name is generated. Duplicated peer names are detected, logged and increment the new metric `alertmanager_cluster_peer_name_conflicts_total`. Signed-off-by: sinkingpoint <colin@quirl.co.nz> Signed-off-by: Siavash Safi <siavash@cloudflare.com>
714f25d to
d741d29
Compare
SuperQ
approved these changes
Oct 28, 2025
Member
SuperQ
left a comment
There was a problem hiding this comment.
Thanks. This is also very useful for deployments like Kubernetes StatefulSet where we can pass the pod name in as an argument.
This was referenced Oct 31, 2025
holger-waschke
pushed a commit
to holger-waschke/alertmanager
that referenced
this pull request
Nov 1, 2025
Currently the default behaviour is to generate a new, random peer name on every startup. It might be desired to have a persistent peer name in consistent setups like running the cluster on bare-metal nodes. This change adds an optional cli arg that allows specifying a custom peer name. If no peer name is specified a random name is generated. Duplicated peer names are detected, logged and increment the new metric `alertmanager_cluster_peer_name_conflicts_total`. Signed-off-by: sinkingpoint <colin@quirl.co.nz> Signed-off-by: Siavash Safi <siavash@cloudflare.com> Co-authored-by: sinkingpoint <colin@quirl.co.nz> Signed-off-by: Holger Waschke <holger.waschke@dvag.com>
Merged
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently the default behaviour is to generate a new, random peer name on every startup.
It might be desired to have a persistent peer name in consistent setups like running the cluster on bare-metal nodes.
This change adds an optional cli arg that allows specifying a custom peer name.
If no peer name is specified a random name is generated.
Duplicated peer names are detected, logged and increment the new metric
alertmanager_cluster_peer_name_conflicts_total.