telemetry

package
v0.158.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package telemetry provides an opinionated set of packages that cover the main concepts of telemetry in an implementation agnostic way. As a library author you should look at

stats (for aggregatable measurements)
trace (for scoped timing spans)
log (for for time based events)

As a binary author you might look at

metric (for methods of aggregating stats)
exporter (for methods of exporting the telemetry to external tools)
debug (for serving lspframework http pages of some of the telemetry)

Index

Constants

View Source
const (
	EventLog = EventType(iota)
	EventStartSpan
	EventEndSpan
	EventTag
	EventDetach
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Type    EventType
	At      time.Time
	Message string
	Error   error
	Tags    TagList
}

func (Event) Format

func (e Event) Format(f fmt.State, r rune)

type EventType

type EventType uint8

type MetricData

type MetricData interface {
	// Handle returns the metric handle this data is for.
	Handle() string
	// Groups reports the rows that currently exist for this metric.
	Groups() []TagList
}

MetricData represents a single point in the time series of a metric. This provides the common interface to all metrics no matter their data format. To get the actual values for the metric you must type assert to a concrete metric type.

type Tag

type Tag struct {
	Key   interface{}
	Value interface{}
}

Tag holds a key and value pair. It is normally used when passing around lists of tags.

func (Tag) Format

func (t Tag) Format(f fmt.State, r rune)

Format is used for debug printing of tags.

type TagList

type TagList []Tag

TagList is a way of passing around a collection of key value pairs. It is an alternative to the less efficient and unordered method of using maps.

func (TagList) Equal

func (l TagList) Equal(other TagList) bool

Equal returns true if two lists are identical.

func (TagList) Format

func (l TagList) Format(f fmt.State, r rune)

Format pretty prints a list. It is intended only for debugging.

func (TagList) Get

func (l TagList) Get(k interface{}) interface{}

Get will get a single key's value from the list.

func (TagList) Less

func (l TagList) Less(other TagList) bool

Less is intended only for using tag lists as a sorting key.

Directories

Path Synopsis
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations.
Package export holds the definition of the telemetry Exporter interface, along with some simple implementations.
ocagent
Package ocagent adds the ability to export all telemetry to an ocagent.
Package ocagent adds the ability to export all telemetry to an ocagent.
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages.
Package log is a context based logging package, designed to interact well with both the lsp protocol and the other telemetry packages.
Package metric aggregates stats into metrics that can be exported.
Package metric aggregates stats into metrics that can be exported.
Package stats provides support for recording telemetry statistics.
Package stats provides support for recording telemetry statistics.
Package tag provides support for telemetry tagging.
Package tag provides support for telemetry tagging.
Package trace adds support for telemetry tracing.
Package trace adds support for telemetry tracing.
Package unit holds the definitions for the units you can use in telemetry.
Package unit holds the definitions for the units you can use in telemetry.

Jump to

Keyboard shortcuts

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