Documentation
¶
Overview ¶
Package telemetry defines the observability exporter boundary for AgentKit. Session JSONL remains the source of truth; exporters mirror turn/step/tool activity to external systems such as Langfuse.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter interface {
BeginTurn(ctx context.Context, meta TurnMeta) (context.Context, func(TurnEnd))
BeginObservation(ctx context.Context, meta ObservationMeta) (context.Context, func(ObservationEnd))
RecordEvent(ctx context.Context, name string, attrs map[string]string)
Flush(ctx context.Context) error
Shutdown(ctx context.Context) error
}
Exporter mirrors agent activity to an external observability backend.
type ObservationEnd ¶
type ObservationEnd struct {
Output string
Err error
Usage *Usage
// CompletionStartTime is when the model first produced output (TTFT boundary).
// Zero means unavailable, e.g. the stream ended before any content arrived.
CompletionStartTime time.Time
// FirstTextTime is when the first user-visible text or thinking delta arrived.
// Langfuse TTFT prefers this over CompletionStartTime when set.
FirstTextTime time.Time
}
ObservationEnd closes an observation.
type ObservationKind ¶
type ObservationKind string
ObservationKind selects how an observation is exported.
const ( KindSpan ObservationKind = "span" KindGeneration ObservationKind = "generation" KindTool ObservationKind = "tool" )
type ObservationMeta ¶
type ObservationMeta struct {
Name string
Kind ObservationKind
Model string
Input string
// ToolNames lists model-visible tools for an LLM generation.
ToolNames []string
// AgentID labels which agent produced this observation.
AgentID string
// SessionID labels the session that produced this observation.
SessionID string
// Scope marks a span that should parent nested generations (e.g. subagent.turn).
Scope bool
}
ObservationMeta describes a nested observation such as an LLM call or tool.
Click to show internal directories.
Click to hide internal directories.