telemetry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

func NewCounter

func NewCounter(meter metric.Meter, name, description, unit string) (*Counter, error)

func (*Counter) Add

func (c *Counter) Add(ctx context.Context, value int64, attrs ...attribute.KeyValue)

func (*Counter) Inc

func (c *Counter) Inc(ctx context.Context, attrs ...attribute.KeyValue)

type Info

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

Info represents an info metric - a gauge that always has value 1 Info metrics are used to expose textual information as labels.

func NewInfo

func NewInfo(meter metric.Meter, name, description string, attrs ...attribute.KeyValue) (*Info, error)

NewInfo creates a new info metric. Under the hood it is a gauge that always reports 1. This is useful for exposing version info, addresses, and other metadata

func (*Info) Record

func (i *Info) Record(ctx context.Context)

Record records the info metric with the given attributes, merging them with existing ones

type Int64Gauge

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

func NewInt64Gauge

func NewInt64Gauge(meter metric.Meter, name string, description string, unit string) (*Int64Gauge, error)

func (*Int64Gauge) Record

func (g *Int64Gauge) Record(ctx context.Context, value int64, attrs ...attribute.KeyValue)

type StopWatch

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

func (*StopWatch) Stop

func (t *StopWatch) Stop(ctx context.Context, attrs ...attribute.KeyValue)

type Telemetry

type Telemetry struct {
	Metrics metric.MeterProvider
	Traces  trace.TracerProvider
	// contains filtered or unexported fields
}

func New

func New(
	ctx context.Context,
	environment, serviceName, serviceVersion, instanceID string,
	metricCollectors metrics.Config,
	tracesCollectors traces.Config,
	resourceOpts ...resource.Option,
) (*Telemetry, error)

func (*Telemetry) Shutdown

func (t *Telemetry) Shutdown(ctx context.Context) error

type Timer

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

func NewTimer

func NewTimer(meter metric.Meter, name, description string, boundaries []float64) (*Timer, error)

func (*Timer) Record

func (t *Timer) Record(ctx context.Context, duration time.Duration, attrs ...attribute.KeyValue)

func (*Timer) Start

func (t *Timer) Start(attrs ...attribute.KeyValue) *StopWatch

type UpDownCounter

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

func NewUpDownCounter

func NewUpDownCounter(meter metric.Meter, name string, description string, unit string) (*UpDownCounter, error)

func (*UpDownCounter) Add

func (c *UpDownCounter) Add(ctx context.Context, value int64, attrs ...attribute.KeyValue)

func (*UpDownCounter) Inc

func (c *UpDownCounter) Inc(ctx context.Context, attrs ...attribute.KeyValue)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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