zookeeperconfigsource

package
v0.50.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README

Zookeeper Config Source (Alpha)

Use the Zookeeper config source to retrieve data from Zookeeper and inject it into your collector configuration.

Configuration

Under the config_sources: use zookeeper: or zookeeper/<name>: to create a Zookeeper config source. The following parameters are available to customize Zookeeper config sources:

config_sources:
  zookeeper:
    # endpoints is an array of Zookeeper server addresses. Config source will 
    # try to connect to these endpoints to access Zookeeper clusters.
    endpoints: [localhost:2181]
    # timeout sets the amount of time for which a session is considered valid after
    # losing connection to a server. Within the session timeout it's possible to 
    # reestablish a connection to a different server and keep the same session.
    timeout: 10s

If multiple paths are needed, create different instances of the config source. For example:

config_sources:
    # Assuming that the environment variable ZOOKEEPER_ADDR is defined and 
    # different secrets are on the same server but at different paths.
    zookeeper:
      endpoints: [$ZOOKEEPER_ADDR]
    zookeeper/another_cluster:
      endpoints: [$ZOOKEEPER_2_ADDR]
      timeout: 15s

# Both Zookeeper config sources can be used via their full name. Hypothetical example:
components:
  component_using_zookeeper:
    token: $zookeeper:/data/token

  component_using_zookeeper_another_cluster:
    token: $zookeeper/another_cluster:/data/token

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() configprovider.Factory

NewFactory returns a new zookeekeper config source factory

Types

type Config

type Config struct {
	expcfg.SourceSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct
	// Endpoints is an array of Zookeeper server addresses. Thr ConfigSource will try to connect
	// to these endpoints to access Zookeeper clusters.
	Endpoints []string `mapstructure:"endpoints"`
	// Timeout sets the amount of time for which a session is considered valid after losing
	// connection to a server. Within the session timeout it's possible to reestablish a connection
	// to a different server and keep the same session.
	Timeout time.Duration `mapstructure:"timeout"`
}

Config defines zookeeperconfigsource configuration

func (*Config) Validate added in v0.38.0

func (*Config) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL