source

package
v0.40.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 158

Documentation

Index

Constants

View Source
const (
	EnvLoggingCfg = "K_LOGGING_CONFIG"
	EnvMetricsCfg = "K_METRICS_CONFIG"
	EnvTracingCfg = "K_TRACING_CONFIG"
)

Variables

This section is empty.

Functions

func WithLogging

func WithLogging(cw *ConfigWatcher, cmw configmap.Watcher)

WithLogging observes a logging ConfigMap.

func WithMetrics

func WithMetrics(cw *ConfigWatcher, cmw configmap.Watcher)

WithMetrics observes a metrics ConfigMap.

func WithTracing

func WithTracing(cw *ConfigWatcher, cmw configmap.Watcher)

WithTracing observes a tracing ConfigMap.

Types

type ConfigAccessor

type ConfigAccessor interface {
	ToEnvVars() []corev1.EnvVar
	LoggingConfig() *logging.Config
	MetricsConfig() *metrics.ExporterOptions
	TracingConfig() *tracingconfig.Config
}

type ConfigWatcher

type ConfigWatcher struct {
	// contains filtered or unexported fields
}

ConfigWatcher keeps track of logging, metrics and tracing configurations by watching corresponding ConfigMaps.

func WatchConfigurations

func WatchConfigurations(loggingCtx context.Context, component string,
	cmw configmap.Watcher, opts ...configWatcherOption) *ConfigWatcher

WatchConfigurations returns a ConfigWatcher initialized with the given options. If no option is passed, the ConfigWatcher observes ConfigMaps for logging, metrics and tracing.

func (*ConfigWatcher) LoggingConfig

func (cw *ConfigWatcher) LoggingConfig() *logging.Config

LoggingConfig returns the logging configuration from the ConfigWatcher.

func (*ConfigWatcher) MetricsConfig

func (cw *ConfigWatcher) MetricsConfig() *metrics.ExporterOptions

MetricsConfig returns the metrics configuration from the ConfigWatcher.

func (*ConfigWatcher) ToEnvVars

func (cw *ConfigWatcher) ToEnvVars() []corev1.EnvVar

ToEnvVars serializes the contents of the ConfigWatcher to individual environment variables.

func (*ConfigWatcher) TracingConfig

func (cw *ConfigWatcher) TracingConfig() *tracingconfig.Config

TracingConfig returns the tracing configuration from the ConfigWatcher.

type EmptyVarsGenerator

type EmptyVarsGenerator struct {
	ConfigAccessor
}

EmptyVarsGenerator generates empty env vars. Intended to be used in tests.

func (*EmptyVarsGenerator) ToEnvVars

func (g *EmptyVarsGenerator) ToEnvVars() []corev1.EnvVar

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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