feat: LLM observability via OTLP (Langfuse and any collector) - #27
Merged
Conversation
Add optional squad.OTLPConfig and traces.ResolveSettings with env-wins precedence. Empty endpoint is unset (no autoexport). Default protocol http/protobuf; capture defaults false. Unknown protocol errors.
Map OpenCode Prompt Info into RunResult, share traces.Write for JSONL plus optional push, skip double-record from watch via SkipRecord, and exit 2 on a bad OTLP protocol before work starts.
File spans.jsonl is default; endpoint env enables live push. Both http/protobuf and grpc; capture default off. Aspire stays wont-port consumer. CONTRIBUTING notes live-traces.ps1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runandwatch --executenow record a parent span plus agen_ai.chatchild (model, tokens, cost, local prompt/completion) to.squad/traces/spans.jsonl. Live OTLP push uses the official Go SDK (http/protobufdefault andgrpc) only when an endpoint is set. Nosquad-oc aspire; Aspire stays a valid consumer, not a shipped dashboard..squad/config.jsonotlp.*. Empty endpoint starts no provider (no localhost:4318 default).OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT). JSONL always stores bodies;traces --exportnever includes them.tracestable adds MODEL / TOKENS / COST and a generation-only cost footer.scripts/live-traces.ps1onD:\xAI\squad-oc-dummyplusscripts/langfuse/(Langfuse v4, 127.0.0.1). CI staysgo test ./....opencode/big-pickle,opencode/hy3-free). This host has noxai/anthropicproviders until/connect.Beads:
squad-2on.1(and children). TUI/SQLite scrape is stillsquad-t9d.Test plan
gofmton changed Go filesgo vet ./...golangci-lint run --timeout=4mgo test ./... -count=1go test -race -count=1on traces / opencodeclient / watch (WinLibs gcc)govulncheck ./...go build ./cmd/squad-ocactionlintscripts/live-traces.ps1on dummy (JSONL + local Langfuse v4 ingest)cicheck on this PR