metrics

package
v1.48.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StorageTypeEnvVar is the name of the env var that defines the type of backend used for metrics storage.
	StorageTypeEnvVar = "METRICS_STORAGE_TYPE"
)

Variables

View Source
var AllStorageTypes = []string{prometheusStorageType}

AllStorageTypes defines all available storage backends.

Functions

This section is empty.

Types

type Factory

type Factory struct {
	FactoryConfig
	// contains filtered or unexported fields
}

Factory implements storage.Factory interface as a meta-factory for storage components.

func NewFactory

func NewFactory(config FactoryConfig) (*Factory, error)

NewFactory creates the meta-factory.

func (*Factory) AddFlags

func (f *Factory) AddFlags(flagSet *flag.FlagSet)

AddFlags implements plugin.Configurable.

func (*Factory) CreateMetricsReader

func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error)

CreateMetricsReader implements storage.MetricsFactory.

func (*Factory) InitFromViper

func (f *Factory) InitFromViper(v *viper.Viper, logger *zap.Logger)

InitFromViper implements plugin.Configurable.

func (*Factory) Initialize

func (f *Factory) Initialize(logger *zap.Logger) error

Initialize implements storage.MetricsFactory.

type FactoryConfig

type FactoryConfig struct {
	MetricsStorageType string
}

FactoryConfig tells the Factory which types of backends it needs to create for different storage types.

func FactoryConfigFromEnv

func FactoryConfigFromEnv() FactoryConfig

FactoryConfigFromEnv reads the desired types of storage backends from METRICS_STORAGE_TYPE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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