zookeeperconfigsource

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 9 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() configsource.Factory

NewFactory returns a new zookeekeper config source factory

Types

type Config

type Config struct {
	configsource.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

Jump to

Keyboard shortcuts

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