telemetry

package
v0.81.12 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package telemetry records named SpeechKit framework outcomes on the active OpenTelemetry span. It is the only place in the public SDK that imports OpenTelemetry, which keeps the root speechkit package free of that dependency (boundary rule 7).

With no TracerProvider installed (the local-only default) RecordOutcome is a zero-cost no-op.

Index

Constants

View Source
const (
	OutcomeEmptyFinalTranscript = "empty_final_transcript"
	OutcomePCMQueueDrop         = "pcm_queue_drop"
	OutcomeAssistEmptySpeak     = "assist_empty_speak"
	OutcomeAssistTTSFailed      = "assist_tts_failed"
)

Outcome names for RecordOutcome. Keep these stable — backends and alerts key on the string, not on log message text.

Variables

This section is empty.

Functions

func RecordOutcome

func RecordOutcome(ctx context.Context, name string, err error, attrs ...Attr)

RecordOutcome attaches a named framework result to the active span.

This is the vendor-neutral error/outcome seam: callers keep using slog for operators, but user-visible failures also land on the trace so a configured OTLP backend can surface them. With no TracerProvider installed (the local-only default) this is a zero-cost no-op.

Types

type Attr

type Attr struct {
	Key   string
	Value any
}

Attr is one key/value pair attached to a recorded outcome. It exists so RecordOutcome does not put OpenTelemetry in an embedder's own signatures: a host records outcomes with SpeechKit's own vocabulary, and whether a tracing backend is installed stays SpeechKit's business.

func BoolAttr

func BoolAttr(key string, v bool) Attr

BoolAttr builds an Attr holding a bool.

func Float64Attr

func Float64Attr(key string, v float64) Attr

Float64Attr builds an Attr holding a float64.

func Int64Attr

func Int64Attr(key string, v int64) Attr

Int64Attr builds an Attr holding an int64.

func StringAttr

func StringAttr(key, value string) Attr

StringAttr builds an Attr holding a string. StringAttr, Int64Attr, Float64Attr and BoolAttr read better at a call site than a struct literal and keep the value's type explicit.

Jump to

Keyboard shortcuts

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