writer

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2024 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	WriterConfig = &WriterYaml{}
)

Functions

func Init

func Init(configDirectory string) error

func WriteTimeSeries

func WriteTimeSeries(tss []prompbmarshal.TimeSeries)

Types

type Global

type Global struct {
	ExtraLabels          *promutils.Labels           `yaml:"extra_labels"`
	RelabelConfigs       []promrelabel.RelabelConfig `yaml:"metric_relabel_configs"`
	ParsedRelabelConfigs *promrelabel.ParsedConfigs  `yaml:"-"`
}

type Writer

type Writer struct {
	URL                  string                      `yaml:"url"`
	RetryTimes           int                         `yaml:"retry_times"`
	RetryIntervalMillis  int64                       `yaml:"retry_interval_millis"`
	BasicAuthUser        string                      `yaml:"basic_auth_user"`
	BasicAuthPass        string                      `yaml:"basic_auth_pass"`
	Headers              []string                    `yaml:"headers"`
	ConnectTimeoutMillis int64                       `yaml:"connect_timeout_millis"`
	RequestTimeoutMillis int64                       `yaml:"request_timeout_millis"`
	MaxIdleConnsPerHost  int                         `yaml:"max_idle_conns_per_host"`
	Concurrency          int                         `yaml:"concurrency"`
	ProxyURL             string                      `yaml:"proxy_url"`
	Interface            string                      `yaml:"interface"`
	FollowRedirects      bool                        `yaml:"follow_redirects"`
	ExtraLabels          *promutils.Labels           `yaml:"extra_labels"`
	RelabelConfigs       []promrelabel.RelabelConfig `yaml:"metric_relabel_configs"`
	ParsedRelabelConfigs *promrelabel.ParsedConfigs  `yaml:"-"`

	clienttls.ClientConfig `yaml:",inline"`
	Client                 *http.Client                   `yaml:"-"`
	RequestQueue           *listx.SafeList[*http.Request] `yaml:"-"`
}

func (*Writer) NewRequest

func (w *Writer) NewRequest(body []byte) (*http.Request, error)

func (*Writer) Parse

func (w *Writer) Parse() error

func (*Writer) StartSender

func (w *Writer) StartSender()

type WriterYaml

type WriterYaml struct {
	Global  *Global   `yaml:"global"`
	Writers []*Writer `yaml:"writers"`
}

func (*WriterYaml) Parse

func (wy *WriterYaml) Parse() (err error)

Jump to

Keyboard shortcuts

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