* Bump cortex deps to include non-experimental memberlist service
* Replace memberlist service in favor of cortex provided service
* Fix route method param for querytee tool
* Register memberlist flags
* Add documentation and example for memberlist
// We do not want to limit pulling new delete requests to a fixed interval which otherwise would limit number of delete requests we process per user.
// While loading delete requests if we find more requests from user pending to be processed, we just set their id in usersWithPendingRequests and
// when a user's delete request gets processed we just check this map to see whether we want to load more requests without waiting for next ticker to load new batch.
usersWithPendingRequestsmap[string]struct{}
usersWithPendingRequestsMtxsync.Mutex
pullNewRequestsChanchanstruct{}
pendingPlansCountmap[string]int// per request pending plan count
f.IntVar(&cfg.MaxOutstandingPerTenant,"querier.max-outstanding-requests-per-tenant",100,"Maximum number of outstanding requests per tenant per frontend; requests beyond this error with HTTP 429.")
f.StringVar(&cfg.DownstreamURL,"frontend.downstream-url","","URL of downstream Prometheus.")
f.DurationVar(&cfg.LogQueriesLongerThan,"frontend.log-queries-longer-than",0,"Log queries that are slower than the specified duration. 0 to disable.")
f.DurationVar(&cfg.LogQueriesLongerThan,"frontend.log-queries-longer-than",0,"Log queries that are slower than the specified duration. Set to 0 to disable. Set to < 0 to enable on all queries.")
}
// Frontend queues HTTP requests, dispatches them to backends, and handles retries
f.StringVar(&cfg.Prefix,flagsPrefix+"prefix",defaultPrefix,"The prefix for the keys in the store. Should end with a /.")
f.StringVar(&cfg.Store,flagsPrefix+"store","consul","Backend storage to use for the ring. Supported values are: consul, etcd, inmemory, multi, memberlist (experimental).")
f.StringVar(&cfg.Store,flagsPrefix+"store","consul","Backend storage to use for the ring. Supported values are: consul, etcd, inmemory, memberlist, multi.")
}
// Client is a high-level client for key-value stores (such as Etcd and
// "Defaults to hostname" -- memberlist sets it to hostname by default.
f.StringVar(&cfg.NodeName,prefix+"memberlist.nodename","","Name of the node in memberlist cluster. Defaults to hostname.")// memberlist.DefaultLANConfig will put hostname here.
f.BoolVar(&cfg.RandomizeNodeName,prefix+"memberlist.randomize-node-name",true,"Add random suffix to the node name.")
f.DurationVar(&cfg.StreamTimeout,prefix+"memberlist.stream-timeout",0,"The timeout for establishing a connection with a remote node, and for read/write operations. Uses memberlist LAN defaults if 0.")
f.IntVar(&cfg.RetransmitMult,prefix+"memberlist.retransmit-factor",0,"Multiplication factor used when sending out messages (factor * log(N+1)).")
f.Var(&cfg.JoinMembers,prefix+"memberlist.join","Other cluster members to join. Can be specified multiple times. Memberlist store is EXPERIMENTAL.")
f.Var(&cfg.JoinMembers,prefix+"memberlist.join","Other cluster members to join. Can be specified multiple times.")
f.DurationVar(&cfg.MinJoinBackoff,prefix+"memberlist.min-join-backoff",1*time.Second,"Min backoff duration to join other cluster members.")
f.DurationVar(&cfg.MaxJoinBackoff,prefix+"memberlist.max-join-backoff",1*time.Minute,"Max backoff duration to join other cluster members.")
f.IntVar(&cfg.MaxJoinRetries,prefix+"memberlist.max-join-retries",10,"Max number of retries to join other cluster members.")
f.BoolVar(&cfg.AbortIfJoinFails,prefix+"memberlist.abort-if-join-fails",true,"If this node fails to join memberlist cluster, abort.")
f.DurationVar(&cfg.RejoinInterval,prefix+"memberlist.rejoin-interval",0,"If not 0, how often to rejoin the cluster. Occasional rejoin can help to fix the cluster split issue, and is harmless otherwise. For example when using only few components as a seed nodes (via -memberlist.join), then it's recommended to use rejoin. If -memberlist.join points to dynamic service that resolves to all gossiping nodes (eg. Kubernetes headless service), then rejoin is not needed.")
f.DurationVar(&cfg.LeftIngestersTimeout,prefix+"memberlist.left-ingesters-timeout",5*time.Minute,"How long to keep LEFT ingesters in the ring.")
f.DurationVar(&cfg.LeaveTimeout,prefix+"memberlist.leave-timeout",5*time.Second,"Timeout for leaving memberlist cluster.")
f.DurationVar(&cfg.GossipInterval,prefix+"memberlist.gossip-interval",0,"How often to gossip. Uses memberlist LAN defaults if 0.")
f.IntVar(&cfg.ServerServicePort,"server.service-port",80,"The port where the query-tee service listens to.")
f.StringVar(&cfg.BackendEndpoints,"backend.endpoints","","Comma separated list of backend endpoints to query.")
f.StringVar(&cfg.PreferredBackend,"backend.preferred","","The hostname of the preferred backend when selecting the response to send back to the client.")
f.StringVar(&cfg.PreferredBackend,"backend.preferred","","The hostname of the preferred backend when selecting the response to send back to the client. If no preferred backend is configured then the query-tee will send back to the client the first successful response received without waiting for other backends.")
f.DurationVar(&cfg.BackendReadTimeout,"backend.read-timeout",90*time.Second,"The timeout when reading the response from a backend.")
f.BoolVar(&cfg.CompareResponses,"proxy.compare-responses",false,"Compare responses between preferred and secondary endpoints for supported routes.")