prometheusremotewriteexporter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

Prometheus Remote Write Exporter

This Exporter sends metrics data in Prometheus TimeSeries format to Cortex or any Prometheus remote write compatible backend.

Non-cumulative monotonic, histogram, and summary OTLP metrics are dropped by this exporter.

The following settings are required:

  • endpoint: protocol:host:port to which the exporter is going to send traces or metrics, using the HTTP/HTTPS protocol.

The following settings can be optionally configured:

  • namespace: prefix attached to each exported metric name.
  • headers: additional headers attached to each HTTP request. If X-Prometheus-Remote-Write-Version is set by user, its value must be 0.1.0
  • insecure (default = false): whether to enable client transport security for the exporter's connection.
  • ca_file: path to the CA cert. For a client this verifies the server certificate. Should only be used if insecure is set to true.
  • cert_file: path to the TLS cert to use for TLS required connections. Should only be used if insecure is set to true.
  • key_file: path to the TLS key to use for TLS required connections. Should only be used if insecure is set to true.
  • timeout (default = 5s): How long to wait until the connection is close.
  • read_buffer_size (default = 0): ReadBufferSize for HTTP client.
  • write_buffer_size (default = 512 * 1024): WriteBufferSize for HTTP client.

Example:

exporters:
prometheusremotewrite:
 endpoint: "http://some.url:9411/api/prom/push"

The full list of settings exposed for this exporter are documented here with detailed sample configurations here.

Here is a link to the overall project design

Documentation

Overview

Note: implementation for this class is in a separate PR

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() component.ExporterFactory

Types

type ByLabelName

type ByLabelName []prompb.Label

ByLabelName enables the usage of sort.Sort() with a slice of labels

func (ByLabelName) Len

func (a ByLabelName) Len() int

func (ByLabelName) Less

func (a ByLabelName) Less(i, j int) bool

func (ByLabelName) Swap

func (a ByLabelName) Swap(i, j int)

type Config

type Config struct {
	// squash ensures fields are correctly decoded in embedded struct.
	configmodels.ExporterSettings  `mapstructure:",squash"`
	exporterhelper.TimeoutSettings `mapstructure:",squash"`
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	exporterhelper.RetrySettings   `mapstructure:"retry_on_failure"`

	// prefix attached to each exported metric name
	// See: https://prometheus.io/docs/practices/naming/#metric-names
	Namespace string `mapstructure:"namespace"`

	HTTPClientSettings confighttp.HTTPClientSettings `mapstructure:",squash"`
}

Config defines configuration for Remote Write exporter.

Jump to

Keyboard shortcuts

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