Help us shape the future of Go! Take the 2026 Go Developer Survey

beacon

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

README

section.io beacon library for Golang

API to generate beacons in the correct format for ingestion by the diagnostics system.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event interface {
	AddContext(key, value string) Event
	AddAnnotation(key, value string) Event
	SetCorrelationID(id string) Event
	WriteToStderr() error
}

TODO export struct instead of interface https://github.com/golang/go/wiki/CodeReviewComments#interfaces

func BeaconSingleInfoCount

func BeaconSingleInfoCount(label string, annotations map[string]string) Event

Convenience method to beacon a single count-type info event, panics if there is a resulting error

func NewEvent

func NewEvent(label string, severity Severity, metricType MetricType, metricValue float64) Event

type MetricType

type MetricType int
const (
	Count MetricType = iota
	Timing
)

func (MetricType) MarshalJSON

func (m MetricType) MarshalJSON() ([]byte, error)

func (MetricType) String

func (m MetricType) String() string

func (*MetricType) UnmarshalJSON

func (m *MetricType) UnmarshalJSON(b []byte) error

type Severity

type Severity int
const (
	Info Severity = iota
	Error
	Warn
	Debug
)

func (Severity) MarshalJSON

func (s Severity) MarshalJSON() ([]byte, error)

func (Severity) String

func (s Severity) String() string

func (*Severity) UnmarshalJSON

func (s *Severity) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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