Documentation ¶
Overview ¶
Package core provides support for event based telemetry.
Index ¶
- func Export(ctx context.Context, ev Event) context.Context
- func ExportPair(ctx context.Context, begin, end Event) (context.Context, func())
- func Log1(ctx context.Context, message string, t1 label.Label)
- func Log2(ctx context.Context, message string, t1 label.Label, t2 label.Label)
- func Metric1(ctx context.Context, t1 label.Label) context.Context
- func Metric2(ctx context.Context, t1, t2 label.Label) context.Context
- func SetExporter(e Exporter)
- func Start1(ctx context.Context, name string, t1 label.Label) (context.Context, func())
- func Start2(ctx context.Context, name string, t1, t2 label.Label) (context.Context, func())
- type Event
- type Exporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportPair ¶
ExportPair is called to deliver a start event to the supplied exporter. It also returns a function that will deliver the end event to the same exporter. It will fill in the time.
func Log1 ¶
Log1 takes a message and one label delivers a log event to the exporter. It is a customized version of Print that is faster and does no allocation.
func Log2 ¶
Log2 takes a message and two labels and delivers a log event to the exporter. It is a customized version of Print that is faster and does no allocation.
func SetExporter ¶
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.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event holds the information about an event of note that occurred.
func CloneEvent ¶
CloneEvent event returns a copy of the event with the time adjusted to at.