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.



This section is empty.


This section is empty.


func AddExporters

func AddExporters(e ...Exporter)

func FinishSpan

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

func Flush

func Flush()

func Log

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

func Metric

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

func StartSpan

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

func Tag

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


type Exporter

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)


func LogWriter

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

func Multi(e ...Exporter) Exporter

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

func Null

func Null() Exporter

Null returns an observer that does nothing.


Path Synopsis
ocagent Package ocagent adds the ability to export all telemetry to an ocagent.