telemetry

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Content managed by Project Forge, see [projectforge.md] for details.

Index

Constants

This section is empty.

Variables

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.2.11

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

func MetricsGauge added in v0.2.11

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

func MetricsHistogram added in v0.2.11

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

func MetricsSummary added in v0.2.11

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

func RunProcess added in v0.2.2

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.2

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.2.11

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

func NewCounterAndGauge added in v0.2.11

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

func (*CounterAndGauge) Observe added in v0.2.11

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

type CounterAndHistogram added in v0.2.11

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

func NewCounterAndHistogram added in v0.2.11

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

func (*CounterAndHistogram) Observe added in v0.2.11

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
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.
Content managed by Project Forge, see [projectforge.md] for details.

Jump to

Keyboard shortcuts

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