export

package
v0.1.2-0...-2a87313 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package export provides configuration management functions

Package export enables data exporting to ingestion backends (e.g. Loki)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URL            string                    `yaml:"url"`
	TenantID       string                    `yaml:"tenantID"`
	BatchWait      time.Duration             `yaml:"batchWait"`
	BatchSize      int                       `yaml:"batchSize"`
	Timeout        time.Duration             `yaml:"timeout"`
	MinBackoff     time.Duration             `yaml:"minBackoff"`
	MaxBackoff     time.Duration             `yaml:"maxBackoff"`
	MaxRetries     int                       `yaml:"maxRetries"`
	Labels         []string                  `yaml:"labels"`
	StaticLabels   model.LabelSet            `yaml:"staticLabels"`
	IgnoreList     []string                  `yaml:"ignoreList"`
	PrintInput     bool                      `yaml:"printInput"`
	PrintOutput    bool                      `yaml:"printOutput"`
	ClientConfig   promconf.HTTPClientConfig `yaml:"clientConfig"`
	TimestampLabel model.LabelName           `yaml:"timestampLabel"`
	// TimestampScale provides the scale in time of the units from the timestamp
	// E.g. UNIX time scale is '1s' (one second) while other clock sources might have
	// scales of '1ms' (one millisecond) or just '1' (one nanosecond)
	// Default value is '1s'
	TimestampScale time.Duration `yaml:"timestampScale"`
}

func DefaultConfig

func DefaultConfig() *Config

func LoadConfig

func LoadConfig(filePath string) (*Config, error)

LoadConfig loads the YAML configuration from the file path passed as argument

func ReadConfig

func ReadConfig(in io.Reader) (*Config, error)

ReadConfig reads a YAML configuration from the io.Reader passed as argument

type Loki

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

Loki record exporter

func NewLoki

func NewLoki(cfg *Config) (Loki, error)

NewLoki creates a Loki flow exporter from a given configuration

func (*Loki) Process

func (l *Loki) Process(in io.Reader) error

Process the flows provided as JSON lines by the input io.Reader until the end of the file

Jump to

Keyboard shortcuts

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