metricexport

package
Version: v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 12

Documentation

Overview

Package metricexport contains support for exporting metric data.

This is an EXPERIMENTAL package, and may change in arbitrary ways without notice.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exporter added in v0.19.3

type Exporter interface {
	ExportMetrics(ctx context.Context, data []*metricdata.Metric) error
}

Exporter is an interface that exporters implement to export the metric data.

type IntervalReader added in v0.19.3

type IntervalReader struct {
	// ReportingInterval it the time duration between two consecutive
	// metrics reporting. defaultReportingDuration  is used if it is not set.
	// It cannot be set lower than minimumReportingDuration.
	ReportingInterval time.Duration
	// contains filtered or unexported fields
}

IntervalReader periodically reads metrics from all producers registered with producer manager and exports those metrics using provided exporter. Call Reader.Stop() to stop the reader.

func NewIntervalReader added in v0.19.3

func NewIntervalReader(reader *Reader, exporter Exporter) (*IntervalReader, error)

NewIntervalReader creates a reader. Once started it periodically reads metrics from all producers and exports them using provided exporter.

func (*IntervalReader) Flush added in v0.22.6

func (ir *IntervalReader) Flush()

Flush flushes the metrics if IntervalReader is stopped, otherwise no-op.

func (*IntervalReader) Start added in v0.19.3

func (ir *IntervalReader) Start() error

Start starts the IntervalReader which periodically reads metrics from all producers registered with global producer manager. If the reporting interval is not set prior to calling this function then default reporting interval is used.

func (*IntervalReader) Stop added in v0.19.3

func (ir *IntervalReader) Stop()

Stop stops the reader from reading and exporting metrics. Additional call to Stop are no-ops.

type Reader added in v0.19.3

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

Reader reads metrics from all producers registered with producer manager and exports those metrics using provided exporter.

func NewReader added in v0.19.3

func NewReader(o ...ReaderOption) *Reader

NewReader returns a reader configured with specified options.

func (*Reader) ReadAndExport added in v0.19.3

func (r *Reader) ReadAndExport(exporter Exporter)

ReadAndExport reads metrics from all producer registered with producer manager and then exports them using provided exporter.

type ReaderOption added in v0.19.3

type ReaderOption func(*ReaderOptions)

ReaderOption apply changes to ReaderOptions.

func WithSpanName added in v0.19.3

func WithSpanName(spanName string) ReaderOption

WithSpanName makes new reader to use given span name when exporting metrics.

type ReaderOptions added in v0.19.3

type ReaderOptions struct {
	// SpanName is the name used for span created to export metrics.
	SpanName string
}

ReaderOptions contains options pertaining to metrics reader.

Jump to

Keyboard shortcuts

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