telemetry

package
v0.48.1 Latest Latest
Warning

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

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

Documentation

Overview

Package telemetry installs the process-wide OpenTelemetry trace pipeline that the Framework kernel's spans (STT routing, TTS, Voice Agent, server lifecycle) feed into. The kernel itself only ever calls otel.Tracer(...), which is a zero-cost no-op until ConfigureTracing installs a real TracerProvider here — so this package is the single, vendor-neutral seam between "SpeechKit emits OpenTelemetry" and "the spans actually go somewhere". It exports over OTLP/HTTP, so any OTLP receiver works (a local collector, Grafana Tempo, or Sentry's OTLP ingestion); nothing in here is vendor-specific beyond the endpoint URL + auth header the caller supplies.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureTracing

func ConfigureTracing(ctx context.Context, opts TracingOptions) (func(context.Context) error, error)

ConfigureTracing installs a process-global OTel TracerProvider that batches the framework's spans to opts.Endpoint over OTLP/HTTP. It returns a shutdown func that flushes pending spans and stops the provider; call it on graceful shutdown. When opts.Endpoint is empty it is a no-op: no provider is set, so otel.Tracer spans stay zero-cost and the prior (no-op) behaviour is kept.

Types

type TracingOptions

type TracingOptions struct {
	// Endpoint is the full OTLP/HTTP traces URL (scheme + host + path), e.g.
	// https://oORG.ingest.de.sentry.io/api/PROJECT/otlp/v1/traces. Empty
	// disables tracing entirely (ConfigureTracing becomes a no-op).
	Endpoint string
	// Headers are attached to every export request — e.g. an auth header such
	// as {"x-sentry-auth": "sentry sentry_key=..."}.
	Headers map[string]string
	// SampleRate is the head sampling ratio in (0,1). Values <=0 or >=1 mean
	// always-sample, the right default for a low-traffic dogfood deployment.
	SampleRate float64
	// ServiceName + Environment + Release tag the exported resource so a
	// backend can separate services and deployments.
	ServiceName string
	Environment string
	Release     string
}

TracingOptions configures the OTLP/HTTP trace exporter and the global TracerProvider it backs.

Jump to

Keyboard shortcuts

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