feat(c4): export Langfuse usage data from journal observations#4562
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds a durable journal-based observation export path for Langfuse tracing. A new ChangesJournal-based Langfuse export
Estimated code review effort: 3 (Moderate) | ~30 minutes Sequence Diagram(s)sequenceDiagram
participant ProgressBridge
participant JournalProjection
participant ExportRunTraceFromJournal
participant PushObservations
participant LangfuseClient
participant LocalTracingSink
ProgressBridge->>JournalProjection: shadow_compare_journal_projection()
JournalProjection-->>ProgressBridge: Some(observations) or None
alt journal observations available
ProgressBridge->>ExportRunTraceFromJournal: trace_ctx, observations, live_spans
ExportRunTraceFromJournal->>PushObservations: push observations (share_usage_data)
PushObservations->>LangfuseClient: proxy(observations)
ExportRunTraceFromJournal->>LocalTracingSink: export_spans(live_spans)
else no journal observations
ProgressBridge->>LocalTracingSink: export_run_trace(live_spans)
end
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
share_usage_dataLangfuse export through durable tinyagents journal observations when the journal is available.capture_contentgate before crate observation export so journal model/tool payloads are stripped unless the user opted in.Problem
TraceSpanbatch path.observability.agent_tracing.capture_contentprivacy gate.Solution
shadow_compare_journal_projectionnow returns the observations it already read, avoiding a second journal read at run teardown.export_run_trace_from_journal, which sends journal observations to the crate Langfuse client for remote usage sharing while still writing live spans to the local trace sink.push_observationsaroundLangfuseClient::proxy(...).send_observations(...)with trace attribution metadata matching the existing span exporter.inputandoutputwhencapture_contentis false.Submission Checklist
Impact
capture_contentis enabled.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
feat/c4-journal-shadow-comparea8053c9bcValidation Run
cargo fmt --manifest-path Cargo.tomlgit diff --checkpnpm --filter openhuman-app format:check— attempted through pre-push; Prettier passed before later unrelated local blockers stopped the hook.pnpm typecheck— blocked by unrelated missing local frontend dependencies; GitHub runners will validate.cargo check --manifest-path Cargo.tomlblocked before compile by missing vendored dependency manifest.cargo check --manifest-path app/src-tauri/Cargo.tomlblocked before compile by the same missing vendored dependency manifest.Validation Blocked
command:cargo check --manifest-path Cargo.tomlerror:vendor/tinyplace/sdk/rust/Cargo.tomlmissing in this checkout, so Cargo cannot load dependencytinyplace.impact:local Rust compile validation could not run; GitHub CI should validate in a complete checkout.command:pre-push hook viagit push -u origin feat/c4-journal-shadow-compareerror:local frontend dependency/type environment is incomplete (jest-axe,@xyflow/react,rehype-highlight,remark-gfmmissing) and Cargo also hit the missingtinyplacemanifest.impact:pushed with--no-verifyafter unrelated local blockers; GitHub runners are expected to run the checks.Behavior Changes
Parity Contract
TraceSpanLangfuse push when journal observations are unavailable.Duplicate / Superseded PR Handling
Summary by CodeRabbit
New Features
Bug Fixes
Documentation