export

package
v0.0.0-...-53e5711 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

Functions

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)

Types

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)

	Flush()
}

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.

Directories

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL