telemetry

package
v0.1.11 Latest Latest
Warning

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

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

Documentation

Overview

Package telemetry exports OpenTelemetry spans. Stdout export is optional.

Index

Constants

View Source
const (

	// GenAI attribute names. The genai module is not a dependency.
	ToolNameAttr    = "gen_ai.tool.name"
	OperationIDAttr = "gen_ai.operation.name"
)

Variables

This section is empty.

Functions

func Allowed

func Allowed(key string) bool

func Attr

func Attr(key, value string) attribute.KeyValue

func Install

func Install(export string) (func(context.Context) error, error)

func StartSpan

func StartSpan(ctx context.Context, name string) (context.Context, trace.Span)

Types

type Recorder

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

func Record

func Record() (*Recorder, error)

Read Spans before Stop. Shutdown clears the exporter.

func (*Recorder) Spans

func (r *Recorder) Spans() []Span

func (*Recorder) Stop

func (r *Recorder) Stop(ctx context.Context) error

type Span

type Span struct {
	Name  string
	Start time.Time
	Attrs map[string]string
}

Jump to

Keyboard shortcuts

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