obs

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package obs holds small helpers shared by the OpenTelemetry instrumentation across teled's internal packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Must

func Must[T any](v T, err error) T

Must panics if err is non-nil, otherwise returns v. It is meant for constructing OpenTelemetry instruments, where an error means a programming mistake (e.g. an invalid instrument name).

Types

type Providers

type Providers struct {
	TracerProvider trace.TracerProvider
	MeterProvider  metric.MeterProvider
}

Providers carries the OpenTelemetry providers threaded explicitly through the application (from go-faster/sdk app.Run) instead of relying on the global otel providers. The zero value is valid and yields no-op instrumentation.

func (Providers) Meter

func (p Providers) Meter(name string) metric.Meter

Meter returns a named meter, falling back to a no-op provider when unset.

func (Providers) Tracer

func (p Providers) Tracer(name string) trace.Tracer

Tracer returns a named tracer, falling back to a no-op provider when unset.

Jump to

Keyboard shortcuts

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