telemetry

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLangfuse

func NewLangfuse(cfg LangfuseConfig, deps LangfuseDeps) (captelemetry.Exporter, error)

NewLangfuse registers telemetry/langfuse: Export traces to Langfuse via OTLP/HTTP.

Best practices:

  • Point baseUrl at your Langfuse region, e.g. https://cloud.langfuse.com.
  • Keep keys in credentials/env via publicKeyRef and secretKeyRef.
  • Pair with runner.default and loop.default telemetry deps so shutdown flushes spans.

func NewNone

func NewNone() (captelemetry.Exporter, error)

NewNone registers telemetry/none: No-op telemetry exporter for default builds.

Types

type Langfuse

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

func (*Langfuse) BeginObservation

func (*Langfuse) BeginTurn

func (l *Langfuse) BeginTurn(ctx context.Context, meta captelemetry.TurnMeta) (context.Context, func(captelemetry.TurnEnd))

func (*Langfuse) Flush

func (l *Langfuse) Flush(ctx context.Context) error

func (*Langfuse) RecordEvent

func (l *Langfuse) RecordEvent(ctx context.Context, name string, attrs map[string]string)

func (*Langfuse) Shutdown

func (l *Langfuse) Shutdown(ctx context.Context) error

type LangfuseConfig

type LangfuseConfig struct {
	// BaseURL is the Langfuse host, e.g. https://cloud.langfuse.com.
	BaseURL string `json:"baseUrl"`
	// PublicKeyRef resolves the Langfuse public key, e.g. env:LANGFUSE_PUBLIC_KEY.
	PublicKeyRef string `json:"publicKeyRef"`
	// SecretKeyRef resolves the Langfuse secret key, e.g. env:LANGFUSE_SECRET_KEY.
	SecretKeyRef string `json:"secretKeyRef"`
	// Environment labels traces in Langfuse.
	Environment string `json:"environment"`
	// Release labels the deploying artifact.
	Release string `json:"release"`
	// SampleRate in (0,1]; 1 exports every turn.
	SampleRate float64 `json:"sampleRate"`
	// FlushIntervalSeconds configures the OTel batch processor interval.
	FlushIntervalSeconds int `json:"flushIntervalSeconds"`
	// MaxPayloadBytes truncates exported input/output payloads.
	MaxPayloadBytes int `json:"maxPayloadBytes"`
	// RedactInputs scrubs sensitive keys from exported inputs.
	RedactInputs bool `json:"redactInputs"`
	// RedactOutputs scrubs sensitive keys from exported outputs.
	RedactOutputs bool `json:"redactOutputs"`
}

type LangfuseDeps

type LangfuseDeps struct {
	Credentials credentials.Store `json:"credentials"`
}

Jump to

Keyboard shortcuts

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