Documentation ¶
Overview ¶
Package prometheusremotewriteexporter implements an exporter that sends Prometheus remote write requests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
func NewFactory() component.ExporterFactory
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 { // 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"` // 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"` }
Config defines configuration for Remote Write exporter.
type PrwExporter ¶
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 ¶
func NewPrwExporter(namespace string, endpoint string, client *http.Client, externalLabels map[string]string) (*PrwExporter, error)
NewPrwExporter initializes a new PrwExporter instance and sets fields accordingly. client parameter cannot be nil.
func (*PrwExporter) PushMetrics ¶
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.