Expand description
Local long-term usage analytics for Roder (roadmap phase 73).
Projects selected runtime events into a queryable SQLite database under
the Roder data directory (<data-dir>/analytics/usage.sqlite3).
Analytics are local-only, passive, idempotent, and redacted by default:
prompts, assistant text, tool output bodies, and secrets never reach the
store. Raw thread-event JSONL remains the durable audit/backfill source.
Re-exports§
pub use backfill::BackfillOptions;pub use backfill::BackfillParseError;pub use backfill::BackfillReport;pub use backfill::backfill_analytics;pub use ingest::AnalyticsIngestor;pub use jsonl::AnalyticsJsonlRecord;pub use model::ANALYTICS_JSONL_SCHEMA_VERSION;pub use model::DailyRollupRow;pub use model::SessionRecord;pub use model::SessionSummary;pub use model::StatsFilter;pub use model::TokenGroup;pub use model::TokenSummaryRow;pub use model::TokenUsageRecord;pub use model::ToolCallRecord;pub use model::ToolSummary;pub use model::TurnRecord;pub use model::UsageSummary;pub use model::WorkspaceLabelMode;pub use query::DEFAULT_LIMIT;pub use query::MAX_LIMIT;pub use query::sort_tool_summaries;pub use sink::ANALYTICS_EXTENSION_ID;pub use sink::ANALYTICS_SINK_ID;pub use sink::UsageAnalyticsExtension;pub use sink::UsageAnalyticsSink;pub use store::AnalyticsStore;pub use store::StoreCounts;
Modules§
- backfill
- Idempotent analytics backfill from per-thread
events.jsonlfiles (roadmap phase 73, Task 3). - ingest
- Projection of canonical
EventEnvelopevalues into analytics records. - jsonl
- Schema-versioned normalized JSONL export (and import for external aggregation round-trips). Exported rows carry ids, names, timestamps, durations, status, and counts only — never prompt/output text.
- model
- Typed analytics records and query filters (roadmap phase 73).
- query
- Typed query APIs: tool summaries with exact percentiles, token summaries by grouping, session summaries, and underutilization helpers.
- rollup
- Daily rollup generation: cached per-day/tool/provider/model/workspace
aggregates for fast dashboards. Raw
tool_calls/token_usagerows stay the source of truth; rollups are recomputed from them on refresh. - sink
- Passive runtime recorder: an
EventSinkextension that projects emitted runtime events into the analytics store. - store
- SQLite-backed analytics store with idempotent upserts.