trace

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package trace adapts fino lifecycle hooks to a minimal tracer.

It is a reference composition for the sufficiency thesis in docs/design.md: observability is a cross-cutting concern carried by the deterministic firing of hooks.Hooks, not by a core capability. The Tracer interface is a tiny, dependency-free seam; an OpenTelemetry adapter belongs in examples, not here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hooks

func Hooks(tr Tracer) *hooks.Hooks

Hooks returns lifecycle hooks that open a span before each model call and tool call and close it afterward, recording the terminating error on OnError.

Types

type EndFunc

type EndFunc func(err error)

EndFunc closes a span. err is nil on success or the terminating error.

type Tracer

type Tracer interface {
	Begin(ctx context.Context, op string) (context.Context, EndFunc)
}

Tracer starts spans. Begin returns a child context and a function to end the span. Implementations must be safe for the single-goroutine hook call order.

Jump to

Keyboard shortcuts

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