tracing

package
v0.0.0-...-332dcef Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLangfuse

func InitLangfuse() (flush func())

InitLangfuse registers a global Langfuse callback handler if LANGFUSE_HOST, LANGFUSE_PUBLIC_KEY, and LANGFUSE_SECRET_KEY are set. Returns a flush function that must be called before process exit.

func InitOTel

func InitOTel(ctx context.Context) (shutdown func())

InitOTel sets up the OpenTelemetry TracerProvider with an OTLP HTTP exporter when OTEL_TRACING_ENABLED is set to "true" or "1". Returns a shutdown function that flushes pending spans.

Types

type SlogEinoHandler

type SlogEinoHandler struct {
	Log *slog.Logger
}

SlogEinoHandler logs full callback payloads as JSON for side-by-side comparison with tape / Langfuse. Stream callbacks only log a placeholder (the StreamReader is not drained here).

func NewSlogEinoHandler

func NewSlogEinoHandler(log *slog.Logger) *SlogEinoHandler

func (*SlogEinoHandler) Needed

func (*SlogEinoHandler) OnEnd

func (*SlogEinoHandler) OnEndWithStreamOutput

func (*SlogEinoHandler) OnError

func (h *SlogEinoHandler) OnError(ctx context.Context, info *callbacks.RunInfo, err error) context.Context

func (*SlogEinoHandler) OnStart

func (*SlogEinoHandler) OnStartWithStreamInput

func (h *SlogEinoHandler) OnStartWithStreamInput(ctx context.Context, info *callbacks.RunInfo, input *schema.StreamReader[callbacks.CallbackInput]) context.Context

Jump to

Keyboard shortcuts

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