aggregation

package
v3.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregatedMetricEntry

func AggregatedMetricEntry(
	ts model.Time,
	totalBytes, totalCount uint64,
	service string,
	lbls labels.Labels,
) string

Types

type BasicAuth

type BasicAuth struct {
	Username string `yaml:"username"           json:"username"`
	// UsernameFile string `yaml:"username_file,omitempty" json:"username_file,omitempty"`
	Password config.Secret `yaml:"password,omitempty" json:"password,omitempty"`
}

BasicAuth contains basic HTTP authentication credentials.

func (*BasicAuth) RegisterFlagsWithPrefix

func (cfg *BasicAuth) RegisterFlagsWithPrefix(prefix string, fs *flag.FlagSet)

type ChunkMetrics

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

func NewChunkMetrics

func NewChunkMetrics(r prometheus.Registerer, metricsNamespace string) *ChunkMetrics

type Config

type Config struct {
	DownsamplePeriod time.Duration           `yaml:"downsample_period"`
	LokiAddr         string                  `yaml:"loki_address,omitempty" doc:"description=The address of the Loki instance to push aggregated metrics to."`
	WriteTimeout     time.Duration           `yaml:"timeout,omitempty" doc:"description=The timeout for writing to Loki."`
	PushPeriod       time.Duration           `yaml:"push_period,omitempty" doc:"description=How long to wait in between pushes to Loki."`
	HTTPClientConfig config.HTTPClientConfig `yaml:"http_client_config,omitempty" doc:"description=The HTTP client configuration for pushing metrics to Loki."`
	UseTLS           bool                    `yaml:"use_tls,omitempty" doc:"description=Whether to use TLS for pushing metrics to Loki."`
	BasicAuth        BasicAuth               `yaml:"basic_auth,omitempty" doc:"description=The basic auth configuration for pushing metrics to Loki."`
	BackoffConfig    backoff.Config          `yaml:"backoff_config,omitempty" doc:"description=The backoff configuration for pushing metrics to Loki."`
}

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(fs *flag.FlagSet)

RegisterFlags registers pattern ingester related flags.

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(fs *flag.FlagSet, prefix string)

type EntryWriter

type EntryWriter interface {
	// WriteEntry handles sending the log to the output
	// To maintain consistent log timing, Write is expected to be non-blocking
	WriteEntry(ts time.Time, entry string, lbls labels.Labels)
	Stop()
}

type Limits added in v3.3.0

type Limits interface {
	MetricAggregationEnabled(userID string) bool
}

type Push

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

Push is a io.Writer, that writes given log entries by pushing directly to the given loki server URL. Each `Push` instance handles for a single tenant. No batching of log lines happens when sending to Loki.

func NewPush

func NewPush(
	lokiAddr, tenantID string,
	timeout time.Duration,
	pushPeriod time.Duration,
	cfg config.HTTPClientConfig,
	username, password string,
	useTLS bool,
	backoffCfg *backoff.Config,
	logger log.Logger,
) (*Push, error)

NewPush creates an instance of `Push` which writes logs directly to given `lokiAddr`

func (*Push) Stop

func (p *Push) Stop()

Stop will cancel any ongoing requests and stop the goroutine listening for requests

func (*Push) WriteEntry

func (p *Push) WriteEntry(ts time.Time, e string, lbls labels.Labels)

WriteEntry implements EntryWriter

Jump to

Keyboard shortcuts

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