prometheusexporter

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

README

Prometheus Exporter

Exports data to a Prometheus back-end.

Supported pipeline types: metrics

Getting Started

The following settings are required:

  • endpoint (no default): Where to send metric data

The following settings can be optionally configured:

  • constlabels (no default): key/values that are applied for every exported metric.
  • namespace (no default): if set, exports metrics under the provided value.
  • send_timestamps (default = false): if true, sends the timestamp of the underlying metric sample in the response.
  • metric_expiration (default = 5m): defines how long metrics are exposed without updates

Example:

exporters:
  prometheus:
    endpoint: "1.2.3.4:1234"
    namespace: test-space
    const_labels:
      label1: value1
      "another label": spaced value
    send_timestamps: true
    metric_expiration: 180m

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory added in v0.8.0

func NewFactory() component.ExporterFactory

NewFactory creates a new Prometheus exporter factory.

Types

type Config

type Config struct {
	*config.ExporterSettings `mapstructure:"-"`

	// The address on which the Prometheus scrape handler will be run on.
	Endpoint string `mapstructure:"endpoint"`

	// Namespace if set, exports metrics under the provided value.
	Namespace string `mapstructure:"namespace"`

	// ConstLabels are values that are applied for every exported metric.
	ConstLabels prometheus.Labels `mapstructure:"const_labels"`

	// SendTimestamps will send the underlying scrape timestamp with the export
	SendTimestamps bool `mapstructure:"send_timestamps"`

	// MetricExpiration defines how long metrics are kept without updates
	MetricExpiration time.Duration `mapstructure:"metric_expiration"`
}

Config defines configuration for Prometheus exporter.

Jump to

Keyboard shortcuts

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