telemetry

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExporterInvalid uint8 = iota
	ExporterPrometheus
	ExporterJaeger
	ExporterOTLP
	ExporterStdout
)

Variables

View Source
var KeyEndpoint = attribute.Key(keyPrefix + "endpoint")
View Source
var KeyOrigin = attribute.Key(keyPrefix + "origin")

Functions

func InitExporter

func InitExporter(ctx context.Context, opts *Options, memStore *cache.MemoryStore, logEntry *logrus.Entry) error

InitExporter initialises configured metrics and/or trace exporter.

func NewSpanFromContext

func NewSpanFromContext(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Types

type ErrorHandleFunc

type ErrorHandleFunc func(error)

func (ErrorHandleFunc) Handle

func (f ErrorHandleFunc) Handle(err error)

type MetricsServer

type MetricsServer struct {
	// contains filtered or unexported fields
}

func NewMetricsServer

func NewMetricsServer(log *logrus.Entry, registry *WrappedRegistry, port int) *MetricsServer

func (*MetricsServer) Close

func (m *MetricsServer) Close() error

func (*MetricsServer) ListenAndServe

func (m *MetricsServer) ListenAndServe()

type Options

type Options struct {
	Metrics              bool
	MetricsCollectPeriod time.Duration // internal collect for pusher configuration
	MetricsEndpoint      string
	MetricsExporter      string
	MetricsPort          int
	ServiceName          string
	Traces               bool
	TracesEndpoint       string
}

type WrappedRegistry added in v1.12.0

type WrappedRegistry struct {
	// contains filtered or unexported fields
}

func NewWrappedRegistry added in v1.12.0

func NewWrappedRegistry(promRegistry *prom.Registry, labels ...*dto.LabelPair) *WrappedRegistry

func (*WrappedRegistry) Gather added in v1.12.0

func (wr *WrappedRegistry) Gather() ([]*dto.MetricFamily, error)

func (*WrappedRegistry) MustRegister added in v1.12.0

func (wr *WrappedRegistry) MustRegister(collector ...prom.Collector)

func (*WrappedRegistry) Register added in v1.12.0

func (wr *WrappedRegistry) Register(collector prom.Collector) error

func (*WrappedRegistry) Unregister added in v1.12.0

func (wr *WrappedRegistry) Unregister(collector prom.Collector) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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