telemetry

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LangfuseTracer

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

LangfuseTracer wraps the Langfuse client and provides eino integration helpers.

func NewLangfuseTracer

func NewLangfuseTracer(cfg *config.LangfuseConfig) *LangfuseTracer

NewLangfuseTracer creates a LangfuseTracer from the config. Returns nil if required credentials are missing.

func (*LangfuseTracer) AgentMiddleware

func (t *LangfuseTracer) AgentMiddleware() adk.AgentMiddleware

AgentMiddleware returns an adk.AgentMiddleware that records model generations and tool-call spans to Langfuse, keyed by the traceID stored in the context.

func (*LangfuseTracer) ChildAgentMiddleware added in v0.0.4

func (t *LangfuseTracer) ChildAgentMiddleware() adk.AgentMiddleware

ChildAgentMiddleware returns an adk.AgentMiddleware for child agents (subagents/teammates). It nests generations and tool spans under the parent span stored in context.

func (*LangfuseTracer) EndChildTrace added in v0.0.4

func (t *LangfuseTracer) EndChildTrace(ctx context.Context, output string)

EndChildTrace closes the child span created by WithChildTrace.

func (*LangfuseTracer) Flush

func (t *LangfuseTracer) Flush()

Flush ensures all buffered events are sent to Langfuse. It blocks at most defaultFlushTimeout to avoid stalling program exit.

func (*LangfuseTracer) WithChildTrace added in v0.0.4

func (t *LangfuseTracer) WithChildTrace(ctx context.Context, name string) context.Context

WithChildTrace creates a child span under the current trace and returns a context carrying both the original traceID and the new parentSpanID. This allows subagent and teammate agent calls to appear as nested spans in Langfuse.

func (*LangfuseTracer) WithNewTrace

func (t *LangfuseTracer) WithNewTrace(ctx context.Context, name string) context.Context

WithNewTrace creates a new Langfuse trace and returns a context carrying its ID.

Jump to

Keyboard shortcuts

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