go.opencensus.io: go.opencensus.io/metric/metricexport Index | Files

package metricexport

import "go.opencensus.io/metric/metricexport"

Package metricexport contains support for exporting metric data.

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

Index

Package Files

doc.go export.go reader.go

type Exporter Uses

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 Uses

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 Uses

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) Start Uses

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 Uses

func (ir *IntervalReader) Stop()

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

type Reader Uses

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 Uses

func NewReader(o ...ReaderOption) *Reader

NewReader returns a reader configured with specified options.

func (*Reader) ReadAndExport Uses

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 Uses

type ReaderOption func(*ReaderOptions)

ReaderOption apply changes to ReaderOptions.

func WithSpanName Uses

func WithSpanName(spanName string) ReaderOption

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

type ReaderOptions Uses

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

ReaderOptions contains options pertaining to metrics reader.

Package metricexport imports 7 packages (graph) and is imported by 3 packages. Updated 2019-07-12. Refresh now. Tools for package owners.