remotewrite

package
v0.0.0-...-1f4d4f1 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapSeries

func MapSeries(ts TimeSeries) prompb.TimeSeries

func MapTagSet

func MapTagSet(t *metrics.SampleTags) []prompb.Label

func MapTrend

func MapTrend(series TimeSeries, t time.Time, sink *trendSink) []prompb.TimeSeries

Types

type Config

type Config struct {
	Mapping null.String `json:"mapping" envconfig:"K6_PROMETHEUS_MAPPING"`

	Url null.String `json:"url" envconfig:"K6_PROMETHEUS_REMOTE_URL"` // here, in the name of env variable, we assume that we won't need to distinguish between remote write URL vs remote read URL

	Headers map[string]string `json:"headers" envconfig:"K6_PROMETHEUS_HEADERS"`

	InsecureSkipTLSVerify null.Bool   `json:"insecureSkipTLSVerify" envconfig:"K6_PROMETHEUS_INSECURE_SKIP_TLS_VERIFY"`
	CACert                null.String `json:"caCertFile" envconfig:"K6_CA_CERT_FILE"`
	CertFile              null.String `json:"certFile" envconfig:"K6_CERT_FILE"`
	KeyFile               null.String `json:"keyFile" envconfig:"K6_KEY_FILE"`

	User     null.String `json:"user" envconfig:"K6_PROMETHEUS_USER"`
	Password null.String `json:"password" envconfig:"K6_PROMETHEUS_PASSWORD"`

	FlushPeriod types.NullDuration `json:"flushPeriod" envconfig:"K6_PROMETHEUS_FLUSH_PERIOD"`

	KeepTags    null.Bool `json:"keepTags" envconfig:"K6_KEEP_TAGS"`
	KeepNameTag null.Bool `json:"keepNameTag" envconfig:"K6_KEEP_NAME_TAG"`
	KeepUrlTag  null.Bool `json:"keepUrlTag" envconfig:"K6_KEEP_URL_TAG"`
}

func GetConsolidatedConfig

func GetConsolidatedConfig(jsonRawConf json.RawMessage, env map[string]string, arg string) (Config, error)

GetConsolidatedConfig combines {default config values + JSON config + environment vars + arg config values}, and returns the final result.

func NewConfig

func NewConfig() Config

func ParseArg

func ParseArg(arg string) (Config, error)

ParseArg takes an arg string and converts it to a config

func (Config) Apply

func (base Config) Apply(applied Config) Config

func (Config) ConstructRemoteConfig

func (conf Config) ConstructRemoteConfig() (*remote.ClientConfig, error)

type Output

type Output struct {
	output.SampleBuffer
	// contains filtered or unexported fields
}

func New

func New(params output.Params) (*Output, error)

func (*Output) Description

func (*Output) Description() string

func (*Output) Start

func (o *Output) Start() error

func (*Output) Stop

func (o *Output) Stop() error

type TimeSeries

type TimeSeries struct {
	Metric *metrics.Metric
	Tags   *metrics.SampleTags
}

Jump to

Keyboard shortcuts

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