Documentation ¶
Index ¶
- Constants
- func New(cfg Config, schedulerAddress string, lookupPeriod time.Duration, ...) (services.Service, error)
- func NewRingClient(cfg RingConfig, component string, logger log.Logger, reg prometheus.Registerer) (*ring.Ring, error)
- func NewRingLifecycler(cfg RingConfig, logger log.Logger, reg prometheus.Registerer) (*ring.BasicLifecycler, error)
- type Config
- type RingConfig
Constants ¶
View Source
const ( ModeFlagName = "query-scheduler.service-discovery-mode" ModeDNS = "dns" ModeRing = "ring" )
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(cfg Config, schedulerAddress string, lookupPeriod time.Duration, component string, receiver servicediscovery.Notifications, logger log.Logger, reg prometheus.Registerer) (services.Service, error)
func NewRingClient ¶
func NewRingClient(cfg RingConfig, component string, logger log.Logger, reg prometheus.Registerer) (*ring.Ring, error)
NewRingClient creates a client for the query-schedulers ring.
func NewRingLifecycler ¶
func NewRingLifecycler(cfg RingConfig, logger log.Logger, reg prometheus.Registerer) (*ring.BasicLifecycler, error)
NewRingLifecycler creates a new query-scheduler ring lifecycler with all required lifecycler delegates.
Types ¶
type Config ¶
type Config struct { Mode string `yaml:"service_discovery_mode" category:"experimental"` SchedulerRing RingConfig `yaml:"ring" doc:"description=The hash ring configuration. The query-schedulers hash ring is used for service discovery."` MaxUsedInstances int `yaml:"max_used_instances"` }
type RingConfig ¶
type RingConfig struct { KVStore kv.Config `` /* 245-byte string literal not displayed */ HeartbeatPeriod time.Duration `yaml:"heartbeat_period" category:"advanced"` HeartbeatTimeout time.Duration `yaml:"heartbeat_timeout" category:"advanced"` // Instance details InstanceID string `yaml:"instance_id" doc:"default=<hostname>" category:"advanced"` InstanceInterfaceNames []string `yaml:"instance_interface_names" doc:"default=[<private network interfaces>]"` InstancePort int `yaml:"instance_port" category:"advanced"` InstanceAddr string `yaml:"instance_addr" category:"advanced"` EnableIPv6 bool `yaml:"instance_enable_ipv6" category:"advanced"` // Injected internally ListenPort int `yaml:"-"` }
RingConfig masks the ring lifecycler config which contains many options not really required by the query-scheduler ring. This config is used to strip down the config to the minimum, and avoid confusion to the user.
func (*RingConfig) RegisterFlags ¶
func (cfg *RingConfig) RegisterFlags(f *flag.FlagSet, logger log.Logger)
RegisterFlags adds the flags required to config this to the given flag.FlagSet.
func (*RingConfig) ToBasicLifecyclerConfig ¶
func (cfg *RingConfig) ToBasicLifecyclerConfig(logger log.Logger) (ring.BasicLifecyclerConfig, error)
ToBasicLifecyclerConfig returns a ring.BasicLifecyclerConfig based on the query-scheduler ring config.
func (*RingConfig) ToRingConfig ¶
func (cfg *RingConfig) ToRingConfig() ring.Config
ToRingConfig returns a ring.Config based on the query-scheduler ring config.
Click to show internal directories.
Click to hide internal directories.