Documentation ¶
Overview ¶
Package prometheusremotewriteexporter sends metrics data to Prometheus Remote Write (PRW) endpoints.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() component.ExporterFactory
NewFactory creates a new Prometheus Remote Write exporter.
Types ¶
type ByLabelName ¶
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 { config.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. 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"` // QueueConfig allows users to fine tune the queues // that handle outgoing requests. RemoteWriteQueue RemoteWriteQueue `mapstructure:"remote_write_queue"` // ExternalLabels defines a map of label keys and values that are allowed to start with reserved prefix "__" ExternalLabels map[string]string `mapstructure:"external_labels"` HTTPClientSettings confighttp.HTTPClientSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct. // ResourceToTelemetrySettings is the option for converting resource attributes to telemetry attributes. // "Enabled" - A boolean field to enable/disable this option. Default is `false`. // If enabled, all the resource attributes will be converted to metric labels by default. exporterhelper.ResourceToTelemetrySettings `mapstructure:"resource_to_telemetry_conversion"` }
Config defines configuration for Remote Write exporter.
type PRWExporter ¶ added in v0.28.0
type PRWExporter struct {
// contains filtered or unexported fields
}
PRWExporter converts OTLP metrics to Prometheus remote write TimeSeries and sends them to a remote endpoint.
func NewPRWExporter ¶ added in v0.28.0
func NewPRWExporter(cfg *Config, buildInfo component.BuildInfo) (*PRWExporter, error)
NewPRWExporter initializes a new PRWExporter instance and sets fields accordingly.
func (*PRWExporter) PushMetrics ¶ added in v0.28.0
PushMetrics converts metrics to Prometheus remote write TimeSeries and send to remote endpoint. It maintain a map of TimeSeries, validates and handles each individual metric, adding the converted TimeSeries to the map, and finally exports the map.
type RemoteWriteQueue ¶ added in v0.27.0
type RemoteWriteQueue struct { // QueueSize is the maximum number of OTLP metric batches allowed // in the queue at a given time. QueueSize int `mapstructure:"queue_size"` // NumWorkers configures the number of workers used by // the collector to fan out remote write requests. NumConsumers int `mapstructure:"num_consumers"` }
RemoteWriteQueue allows to configure the remote write queue.