telemetry

package
v0.0.169 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package telemetry owns synchronizer operational instrumentation. Providers and transport are supplied by go-logger/otelsetup; sandbox events are independent.

Index

Constants

View Source
const EndpointEnv = "OTEL_EXPORTER_OTLP_ENDPOINT"

Variables

This section is empty.

Functions

func ConfigureEndpoint

func ConfigureEndpoint(ctx context.Context, base string, get func(context.Context, string) (schema.IBackendServices, error)) error

ConfigureEndpoint intentionally distinguishes unset from explicitly empty. It never discovers or modifies the independent sandbox events endpoint.

func Init

func Init(ctx context.Context, cfg otelsetup.ProviderConfig, apiURL string) func()

Init must precede logger and instrument construction. All telemetry failures are nonfatal; errors are deliberately fixed text to avoid leaking endpoints.

func LoadServices

func LoadServices(ctx context.Context, base string) (schema.IBackendServices, error)

LoadServices reuses the v3 client URL/parser with a bounded transport. The shared client's Get uses http.Get without a deadline or response-body close.

Types

type Instruments

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

func Default

func Default() *Instruments

func New

func New() *Instruments

func (*Instruments) Begin

func (i *Instruments) Begin(ctx context.Context, op string) func(error, int)

Begin aggregates ordinary work; only completed operations taking >=1s create a retrospective slow span, with an additional process-wide 10s creation gate. A timer exists only while work is active and is stopped on completion.

func (*Instruments) Connection

func (i *Instruments) Connection(ctx context.Context, delta int64)

func (*Instruments) Control

func (i *Instruments) Control(ctx context.Context, op string) (context.Context, func(error))

Control creates a bounded connection-establishment span and propagates its context during the handshake. Remote sampling never bypasses the local gate.

func (*Instruments) Drop

func (i *Instruments) Drop(ctx context.Context, reason string)

func (*Instruments) Span

func (i *Instruments) Span(ctx context.Context, op string, start time.Time, err error)

Span is also used for connection establishment (never connection lifetime).

Jump to

Keyboard shortcuts

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