tools: Index | Files | Directories

package export

import ""

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.


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.
    Log(context.Context, telemetry.Event)

    Metric(context.Context, telemetry.MetricData)


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.


ocagentPackage ocagent adds the ability to export all telemetry to an ocagent.

Package export imports 7 packages (graph) and is imported by 23 packages. Updated 2020-02-22. Refresh now. Tools for package owners.