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

package event

import "golang.org/x/tools/internal/event"

Package event provides a set of packages that cover the main concepts of telemetry in an implementation agnostic way.

Index

Package Files

doc.go event.go

func Detach Uses

func Detach(ctx context.Context) context.Context

Detach returns a context without an associated span. This allows the creation of spans that are not children of the current span.

func Error Uses

func Error(ctx context.Context, message string, err error, labels ...label.Label)

Error takes a message and a label list and combines them into a single event before delivering them to the exporter. It captures the error in the delivered event.

func IsDetach Uses

func IsDetach(ev core.Event) bool

IsDetach returns true if the event was built by the Detach function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsEnd Uses

func IsEnd(ev core.Event) bool

IsEnd returns true if the event was built by the End function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsError Uses

func IsError(ev core.Event) bool

IsError returns true if the event was built by the Error function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsLabel Uses

func IsLabel(ev core.Event) bool

IsLabel returns true if the event was built by the Label function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsLog Uses

func IsLog(ev core.Event) bool

IsLog returns true if the event was built by the Log function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsMetric Uses

func IsMetric(ev core.Event) bool

IsMetric returns true if the event was built by the Metric function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func IsStart Uses

func IsStart(ev core.Event) bool

IsStart returns true if the event was built by the Start function. It is intended to be used in exporters to identify the semantics of the event when deciding what to do with it.

func Label Uses

func Label(ctx context.Context, labels ...label.Label) context.Context

Label sends a label event to the exporter with the supplied labels.

func Log Uses

func Log(ctx context.Context, message string, labels ...label.Label)

Log takes a message and a label list and combines them into a single event before delivering them to the exporter.

func Metric Uses

func Metric(ctx context.Context, labels ...label.Label)

Metric sends a label event to the exporter with the supplied labels.

func SetExporter Uses

func SetExporter(e Exporter)

SetExporter sets the global exporter function that handles all events. The exporter is called synchronously from the event call site, so it should return quickly so as not to hold up user code.

func Start Uses

func Start(ctx context.Context, name string, labels ...label.Label) (context.Context, func())

Start sends a span start event with the supplied label list to the exporter. It also returns a function that will end the span, which should normally be deferred.

type Exporter Uses

type Exporter func(context.Context, core.Event, label.Map) context.Context

Exporter is a function that handles events. It may return a modified context and event.

Directories

PathSynopsis
corePackage core provides support for event based telemetry.
export
export/eventtestPackage eventtest supports logging events to a test.
export/metricPackage metric aggregates events into metrics that can be exported.
export/ocagentPackage ocagent adds the ability to export all telemetry to an ocagent.
export/ocagent/wire
export/prometheus
keys
label

Package event imports 4 packages (graph) and is imported by 29 packages. Updated 2020-09-18. Refresh now. Tools for package owners.