telemetry

package
v0.6.13 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package telemetry installs OpenTelemetry through xtrace's SDK bootstrap: resource from the build identity, exporters from the standard OTEL_* environment. A signal without an OTLP endpoint is not exported (xtrace decides per signal), so a service never retries a collector that does not exist.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Identity

type Identity struct {
	Service, Version, Instance, Environment string
}

Identity stamped into the resource.

type Telemetry

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

Telemetry is a lifecycle component; start it first, it stops last.

func New

func New(id Identity, log *xlog.Logger) *Telemetry

New creates the component.

func (*Telemetry) Start

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

Start installs global providers and the propagator.

func (*Telemetry) Status

func (t *Telemetry) Status() (configured, up bool, err error)

Status of OTLP export for the instance state: configured when an OTEL_EXPORTER_OTLP_*ENDPOINT is set; up unless the setup failed (export errors after setup are not tracked).

func (*Telemetry) Stop

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

Stop flushes and shuts the providers down.

Jump to

Keyboard shortcuts

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