{"id":14971903,"url":"https://github.com/grafana/memberlist","last_synced_at":"2025-10-01T19:30:57.239Z","repository":{"id":41855005,"uuid":"433378144","full_name":"grafana/memberlist","owner":"grafana","description":"Golang package for gossip based membership and failure detection","archived":false,"fork":true,"pushed_at":"2025-01-19T09:21:51.000Z","size":1228,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-19T10:26:26.816Z","etag":null,"topics":["keep"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"hashicorp/memberlist","license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.go","support":null}},"created_at":"2021-11-30T09:59:05.000Z","updated_at":"2025-01-16T12:23:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/grafana/memberlist","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fmemberlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fmemberlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fmemberlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fmemberlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/memberlist/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234892715,"owners_count":18902907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["keep"],"created_at":"2024-09-24T13:46:03.244Z","updated_at":"2025-10-01T19:30:57.227Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# memberlist [![GoDoc](https://godoc.org/github.com/hashicorp/memberlist?status.png)](https://godoc.org/github.com/hashicorp/memberlist) [![CircleCI](https://circleci.com/gh/hashicorp/memberlist.svg?style=svg)](https://circleci.com/gh/hashicorp/memberlist)\n\nmemberlist is a [Go](http://www.golang.org) library that manages cluster\nmembership and member failure detection using a gossip based protocol.\n\nThe use cases for such a library are far-reaching: all distributed systems\nrequire membership, and memberlist is a re-usable solution to managing\ncluster membership and node failure detection.\n\nmemberlist is eventually consistent but converges quickly on average.\nThe speed at which it converges can be heavily tuned via various knobs\non the protocol. Node failures are detected and network partitions are partially\ntolerated by attempting to communicate to potentially dead nodes through\nmultiple routes.\n\n## Building\n\nIf you wish to build memberlist you'll need Go version 1.2+ installed.\n\nPlease check your installation with:\n\n```\ngo version\n```\n\n## Usage\n\nMemberlist is surprisingly simple to use. An example is shown below:\n\n```go\n/* Create the initial memberlist from a safe configuration.\n   Please reference the godoc for other default config types.\n   http://godoc.org/github.com/hashicorp/memberlist#Config\n*/\nlist, err := memberlist.Create(memberlist.DefaultLocalConfig())\nif err != nil {\n\tpanic(\"Failed to create memberlist: \" + err.Error())\n}\n\n// Join an existing cluster by specifying at least one known member.\nn, err := list.Join([]string{\"1.2.3.4\"})\nif err != nil {\n\tpanic(\"Failed to join cluster: \" + err.Error())\n}\n\n// Ask for members of the cluster\nfor _, member := range list.Members() {\n\tfmt.Printf(\"Member: %s %s\\n\", member.Name, member.Addr)\n}\n\n// Continue doing whatever you need, memberlist will maintain membership\n// information in the background. Delegates can be used for receiving\n// events when members join or leave.\n```\n\nThe most difficult part of memberlist is configuring it since it has many\navailable knobs in order to tune state propagation delay and convergence times.\nMemberlist provides a default configuration that offers a good starting point,\nbut errs on the side of caution, choosing values that are optimized for\nhigher convergence at the cost of higher bandwidth usage.\n\nFor complete documentation, see the associated [Godoc](http://godoc.org/github.com/hashicorp/memberlist).\n\n## Protocol\n\nmemberlist is based on [\"SWIM: Scalable Weakly-consistent Infection-style Process Group Membership Protocol\"](http://ieeexplore.ieee.org/document/1028914/). However, we extend the protocol in a number of ways:\n\n* Several extensions are made to increase propagation speed and\nconvergence rate.\n* Another set of extensions, that we call Lifeguard, are made to make memberlist more robust in the presence of slow message processing (due to factors such as CPU starvation, and network delay or loss).\n\nFor details on all of these extensions, please read our paper \"[Lifeguard : SWIM-ing with Situational Awareness](https://arxiv.org/abs/1707.00788)\", along with the memberlist source.  We welcome any questions related\nto the protocol on our issue tracker.\n\n## Metrics Emission and Compatibility\n\nThis library can emit metrics using either `github.com/armon/go-metrics` or `github.com/hashicorp/go-metrics`. Choosing between the libraries is controlled via build tags. \n\n**Build Tags**\n* `armonmetrics` - Using this tag will cause metrics to be routed to `armon/go-metrics`\n* `hashicorpmetrics` - Using this tag will cause all metrics to be routed to `hashicorp/go-metrics`\n\nIf no build tag is specified, the default behavior is to use `armon/go-metrics`. \n\n**Deprecating `armon/go-metrics`**\n\nEmitting metrics to `armon/go-metrics` is officially deprecated. Usage of `armon/go-metrics` will remain the default until mid-2025 with opt-in support continuing to the end of 2025.\n\n**Migration**\nTo migrate an application currently using the older `armon/go-metrics` to instead use `hashicorp/go-metrics` the following should be done.\n\n1. Upgrade libraries using `armon/go-metrics` to consume `hashicorp/go-metrics/compat` instead. This should involve only changing import statements. All repositories in the `hashicorp` namespace\n2. Update an applications library dependencies to those that have the compatibility layer configured.\n3. Update the application to use `hashicorp/go-metrics` for configuring metrics export instead of `armon/go-metrics`\n   * Replace all application imports of `github.com/armon/go-metrics` with `github.com/hashicorp/go-metrics`\n   * Instrument your build system to build with the `hashicorpmetrics` tag.\n\nEventually once the default behavior changes to use `hashicorp/go-metrics` by default (mid-2025), you can drop the `hashicorpmetrics` build tag.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fmemberlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fmemberlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fmemberlist/lists"}