observability

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: May 1, 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 LogEntry

type LogEntry struct {
	Timestamp    time.Time `json:"timestamp"`
	Command      string    `json:"command,omitempty"`
	Task         string    `json:"task,omitempty"`
	Action       string    `json:"action,omitempty"`
	Model        string    `json:"model,omitempty"`
	Provider     string    `json:"provider,omitempty"`
	InputTokens  int       `json:"input_tokens,omitempty"`
	OutputTokens int       `json:"output_tokens,omitempty"`
	LatencyMs    int64     `json:"latency_ms,omitempty"`
	Score        float64   `json:"score,omitempty"`
	UserAction   string    `json:"user_action,omitempty"`
	Success      bool      `json:"success"`
	Error        string    `json:"error,omitempty"`
	Note         string    `json:"note,omitempty"`
}

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) LogAICall

func (l *Logger) LogAICall(provider, model, task string, in, out int, latencyMs int64, err error)

func (*Logger) LogApproval

func (l *Logger) LogApproval(action, userAction string)

func (*Logger) LogCommand

func (l *Logger) LogCommand(command, note string, success bool, err error)

func (*Logger) LogStep

func (l *Logger) LogStep(task, action, _ string, score float64)

func (*Logger) Path

func (l *Logger) Path() string

type Metrics

type Metrics struct {
	TotalCalls       int                `json:"total_calls"`
	SuccessRate      float64            `json:"success_rate"`
	ApprovalRate     float64            `json:"approval_rate"`
	EditRate         float64            `json:"edit_rate"`
	FallbackRate     float64            `json:"fallback_rate"`
	AvgLatencyMs     float64            `json:"avg_latency_ms"`
	AvgScore         float64            `json:"avg_score"`
	ScoreByAction    map[string]float64 `json:"score_by_action"`
	ApprovalByAction map[string]float64 `json:"approval_by_action"`
}

func ComputeMetrics

func ComputeMetrics(logPath string) (*Metrics, error)

Jump to

Keyboard shortcuts

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