telemetry

package
v1.4.10 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Enabled = true
)
View Source
var SkipControllerMetrics = util.GetEnvBool("controller_metrics_disabled", false)

Functions

func Close

func Close(ctx context.Context) error

func Initialize

func Initialize(_ string, logger util.Logger)

func InitializeIfNeeded

func InitializeIfNeeded(enabled bool, version string, logger util.Logger) bool

func LoggerFor

func LoggerFor(logger util.Logger, span *Span) util.Logger

func MetricsCounter added in v0.6.7

func MetricsCounter(subsystem string, name string, help string, logger util.Logger, labelNames ...string) *prometheus.CounterVec

func MetricsGauge added in v0.6.7

func MetricsGauge(subsystem string, name string, help string, logger util.Logger, labelNames ...string) *prometheus.GaugeVec

func MetricsHistogram added in v0.6.7

func MetricsHistogram(subsystem string, name string, help string, logger util.Logger, labelNames ...string) *prometheus.HistogramVec

func MetricsSummary added in v0.6.7

func MetricsSummary(subsystem string, name string, help string, logger util.Logger) prometheus.Summary

func RunProcess added in v0.2.30

func RunProcess(ctx context.Context, cmd string, path string, in io.Reader, out io.Writer, er io.Writer, logger util.Logger) (int, error)

func RunProcessSimple added in v0.2.30

func RunProcessSimple(ctx context.Context, cmd string, path string, logger util.Logger) (int, string, error)

func WrapHTTPClient

func WrapHTTPClient(cl *http.Client) *http.Client

Types

type Attribute

type Attribute struct {
	Key   string `json:"key"`
	Value any    `json:"value"`
}

func (*Attribute) ToOT

func (a *Attribute) ToOT() attribute.KeyValue

type CounterAndGauge added in v0.6.7

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

func NewCounterAndGauge added in v0.6.7

func NewCounterAndGauge(subsystem string, name string, help string, logger util.Logger, labelNames ...string) *CounterAndGauge

func (*CounterAndGauge) Observe added in v0.6.7

func (x *CounterAndGauge) Observe(labelValues ...string)

type CounterAndHistogram added in v0.6.7

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

func NewCounterAndHistogram added in v0.6.7

func NewCounterAndHistogram(subsystem string, name string, help string, logger util.Logger, labelNames ...string) *CounterAndHistogram

func (*CounterAndHistogram) Observe added in v0.6.7

func (x *CounterAndHistogram) Observe(startTime time.Time, labelValues ...string)

type ErrHandler

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

func (*ErrHandler) Handle

func (e *ErrHandler) Handle(err error)

type Span

type Span struct {
	OT trace.Span
	// contains filtered or unexported fields
}

func StartAsyncSpan

func StartAsyncSpan(ctx context.Context, spanName string, logger util.Logger, opts ...any) (context.Context, *Span, util.Logger)

func StartSpan

func StartSpan(ctx context.Context, spanName string, logger util.Logger, opts ...any) (context.Context, *Span, util.Logger)

func (*Span) Attribute

func (s *Span) Attribute(k string, v any)

func (*Span) Attributes

func (s *Span) Attributes(attrs ...*Attribute)

func (*Span) Complete

func (s *Span) Complete()

Complete must be called, usually through a `defer` block.

func (*Span) Event

func (s *Span) Event(name string, attrs ...*Attribute)

func (*Span) OnError

func (s *Span) OnError(err error)

func (*Span) SetHTTPStatus

func (s *Span) SetHTTPStatus(code int)

func (*Span) SetName

func (s *Span) SetName(name string)

func (*Span) SetStatus

func (s *Span) SetStatus(status string, description string)

func (*Span) SpanID

func (s *Span) SpanID() string

func (*Span) String

func (s *Span) String() string

func (*Span) TraceID

func (s *Span) TraceID() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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