otel: go.opentelemetry.io/otel/sdk/metric/controller/push Index | Files

package push

import "go.opentelemetry.io/otel/sdk/metric/controller/push"

Index

Package Files

push.go

type Clock Uses

type Clock interface {
    Now() time.Time
    Ticker(time.Duration) Ticker
}

type Controller Uses

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

Controller organizes a periodic push of metric data.

func New Uses

func New(batcher export.Batcher, exporter export.Exporter, period time.Duration) *Controller

New constructs a Controller, an implementation of metric.Provider, using the provided batcher, exporter, and collection period to configure an SDK with periodic collection. The batcher itself is configured with the aggregation selector policy.

If the Exporter implements the export.LabelEncoder interface, the exporter will be used as the label encoder for the SDK itself, otherwise the SDK will be configured with the default label encoder.

func (*Controller) Meter Uses

func (c *Controller) Meter(_ string) metric.Meter

Meter returns a named Meter, satisifying the metric.Provider interface.

func (*Controller) SetClock Uses

func (c *Controller) SetClock(clock Clock)

SetClock supports setting a mock clock for testing. This must be called before Start().

func (*Controller) SetErrorHandler Uses

func (c *Controller) SetErrorHandler(errorHandler sdk.ErrorHandler)

func (*Controller) Start Uses

func (c *Controller) Start()

Start begins a ticker that periodically collects and exports metrics with the configured interval.

func (*Controller) Stop Uses

func (c *Controller) Stop()

Stop waits for the background goroutine to return and then collects and exports metrics one last time before returning.

type Ticker Uses

type Ticker interface {
    Stop()
    C() <-chan time.Time
}

Package push imports 6 packages (graph) and is imported by 6 packages. Updated 2019-12-29. Refresh now. Tools for package owners.