tools: golang.org/x/tools/internal/telemetry/export Index | Files | Directories

package export

import "golang.org/x/tools/internal/telemetry/export"

Package export holds the definition of the telemetry Exporter interface, along with some simple implementations. Larger more complex exporters are in sub packages of their own.

Index

Package Files

export.go log.go multi.go null.go

func AddExporters Uses

func AddExporters(e ...Exporter)

func FinishSpan Uses

func FinishSpan(ctx context.Context, span *telemetry.Span, at time.Time)

func Flush Uses

func Flush()

func Log Uses

func Log(ctx context.Context, event telemetry.Event)

func Metric Uses

func Metric(ctx context.Context, data telemetry.MetricData)

func StartSpan Uses

func StartSpan(ctx context.Context, span *telemetry.Span, at time.Time)

func Tag Uses

func Tag(ctx context.Context, at time.Time, tags telemetry.TagList)

type Exporter Uses

type Exporter interface {
    StartSpan(context.Context, *telemetry.Span)
    FinishSpan(context.Context, *telemetry.Span)

    // Log is a function that handles logging events.
    // Observers may use information in the context to decide what to do with a
    // given log event. They should return true if they choose to handle the
    Log(context.Context, telemetry.Event)

    Metric(context.Context, telemetry.MetricData)

    Flush()
}

func LogWriter Uses

func LogWriter(w io.Writer, onlyErrors bool) Exporter

LogWriter returns an observer that logs events to the supplied writer. If onlyErrors is true it does not log any event that did not have an associated error. It ignores all telemetry other than log events.

func Multi Uses

func Multi(e ...Exporter) Exporter

Multi returns an exporter that invokes all the exporters given to it in order.

func Null Uses

func Null() Exporter

Null returns an observer that does nothing.

Directories

PathSynopsis
ocagentPackage ocagent adds the ability to export all telemetry to an ocagent.
ocagent/wire
prometheus

Package export imports 7 packages (graph) and is imported by 10 packages. Updated 2019-09-20. Refresh now. Tools for package owners.