cortex

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory implements storage.Factory and creates write-only storage components backed by kafka.

func NewFactory

func NewFactory() *Factory

NewFactory creates a new Factory.

func (*Factory) AddFlags

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

AddFlags implements plugin.Configurable

func (*Factory) CreateWriter

func (f *Factory) CreateWriter() (metricstore.Writer, error)

func (*Factory) InitFromOptions

func (f *Factory) InitFromOptions(o Options)

InitFromOptions initializes factory from options.

func (*Factory) InitFromViper

func (f *Factory) InitFromViper(v *viper.Viper)

InitFromViper implements plugin.Configurable

func (*Factory) Initialize

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

type Marshaller

type Marshaller interface {
	MarshalMetric([]prompb.TimeSeries) ([]byte, error)
}

Marshaller encodes a metric into a byte array to be sent to Kafka

type Options

type Options struct {
	Encoding string
	// contains filtered or unexported fields
}

func (*Options) AddFlags

func (o *Options) AddFlags(flagSet *flag.FlagSet)

func (*Options) InitFromViper

func (o *Options) InitFromViper(v *viper.Viper)

type Writer

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

Writer writes metric to kafka. Implements metricstore.Writer

func NewMetricWriter

func NewMetricWriter(
	logger *zap.Logger,
	factory metrics.Factory,
	options Options,
	marshaller Marshaller,
) *Writer

func (*Writer) WriteMetric

func (w *Writer) WriteMetric(metric []prompb.TimeSeries) error

type WriterMetrics

type WriterMetrics struct {
	WrittenSuccess metrics.Counter
	WrittenFailure metrics.Counter
}

Jump to

Keyboard shortcuts

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