otel: go.opentelemetry.io/otel/sdk/metric/processor/basic Index | Files

package basic

import "go.opentelemetry.io/otel/sdk/metric/processor/basic"


Package Files

basic.go config.go


var ErrInconsistentState = fmt.Errorf("inconsistent processor state")
var ErrInvalidExportKind = fmt.Errorf("invalid export kind")

type Config Uses

type Config struct {
    // Memory controls whether the processor remembers metric
    // instruments and label sets that were previously reported.
    // When Memory is true, CheckpointSet.ForEach() will visit
    // metrics that were not updated in the most recent interval.
    Memory bool

Config contains the options for configuring a basic metric processor.

type Option Uses

type Option interface {

func WithMemory Uses

func WithMemory(memory bool) Option

WithMemory sets the memory behavior of a Processor. If this is true, the processor will report metric instruments and label sets that were previously reported but not updated in the most recent interval.

type Processor Uses

type Processor struct {
    // contains filtered or unexported fields

func New Uses

func New(aselector export.AggregatorSelector, eselector export.ExportKindSelector, opts ...Option) *Processor

New returns a basic Processor that is also a Checkpointer using the provided AggregatorSelector to select Aggregators. The ExportKindSelector is consulted to determine the kind(s) of exporter that will consume data, so that this Processor can prepare to compute Delta or Cumulative Aggregations as needed.

func (*Processor) CheckpointSet Uses

func (b *Processor) CheckpointSet() export.CheckpointSet

CheckpointSet returns the associated CheckpointSet. Use the CheckpointSet Locker interface to synchronize access to this object. The CheckpointSet.ForEach() method cannot be called concurrently with Process().

func (*Processor) FinishCollection Uses

func (b *Processor) FinishCollection() error

FinishCollection signals to the Processor that a complete collection has finished and that ForEach will be called to access the CheckpointSet.

func (*Processor) ForEach Uses

func (b *Processor) ForEach(exporter export.ExportKindSelector, f func(export.Record) error) error

ForEach iterates through the CheckpointSet, passing an export.Record with the appropriate Cumulative or Delta aggregation to an exporter.

func (*Processor) Process Uses

func (b *Processor) Process(accum export.Accumulation) error

Process implements export.Processor.

func (*Processor) StartCollection Uses

func (b *Processor) StartCollection()

StartCollection signals to the Processor one or more Accumulators will begin calling Process() calls during collection.

Package basic imports 9 packages (graph) and is imported by 11 packages. Updated 2021-01-14. Refresh now. Tools for package owners.