exporter

package
v0.0.0-...-5655933 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package exporter provides the interface for getting metrics out of mtail, into your monitoring system of choice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter manages the export of metrics to passive and active collectors.

func New

func New(ctx context.Context, wg *sync.WaitGroup, store *metrics.Store, options ...Option) (*Exporter, error)

New creates a new Exporter.

func (*Exporter) Collect

func (e *Exporter) Collect(c chan<- prometheus.Metric)

Collect implements the prometheus.Collector interface.

func (*Exporter) Describe

func (e *Exporter) Describe(c chan<- *prometheus.Desc)

Describe implements the prometheus.Collector interface.

func (*Exporter) HandleGraphite

func (e *Exporter) HandleGraphite(w http.ResponseWriter, r *http.Request)

func (*Exporter) HandleJSON

func (e *Exporter) HandleJSON(w http.ResponseWriter, r *http.Request)

HandleJSON exports the metrics in JSON format via HTTP.

func (*Exporter) HandleVarz

func (e *Exporter) HandleVarz(w http.ResponseWriter, r *http.Request)

HandleVarz exports the metrics in Varz format via HTTP.

func (*Exporter) PushMetrics

func (e *Exporter) PushMetrics()

PushMetrics sends metrics to each of the configured services.

func (*Exporter) RegisterPushExport

func (e *Exporter) RegisterPushExport(p pushOptions)

RegisterPushExport adds a push export connection to the Exporter. Items in the list must describe a Dial()able connection and will have all the metrics pushed to each pushInterval.

func (*Exporter) SetOption

func (e *Exporter) SetOption(options ...Option) error

SetOption takes one or more option functions and applies them in order to Exporter.

func (*Exporter) StartMetricPush

func (e *Exporter) StartMetricPush()

StartMetricPush pushes metrics to the configured services each interval.

func (*Exporter) Write

func (e *Exporter) Write(w io.Writer) error

Write is used to write Prometheus metrics to an io.Writer.

type Option

type Option func(*Exporter) error

Option configures a new Exporter.

func EmitTimestamp

func EmitTimestamp() Option

EmitTimestamp instructs the exporter to send metric's timestamps to collectors.

func Hostname

func Hostname(hostname string) Option

Hostname specifies the mtail hostname to use in exported metrics.

func OmitProgLabel

func OmitProgLabel() Option

OmitProgLabel sets the Exporter to not put program names in metric labels.

func PushInterval

func PushInterval(opt time.Duration) Option

Jump to

Keyboard shortcuts

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