feat(metrics): RSS worker LLM token usage on /metrics (6.9.1) #14

Merged
tim merged 2 commits from feat/usage-metrics into develop 2026-10-15 10:48:25 +00:00
Owner

What

  • The RSS worker adds each Anthropic call's tokens to meta:usage:<call> hashes in Valkey (summary, extract, score): calls, input, cache_read, cache_creation, output. Cumulative, so rate() works across restarts.
  • The web UI's /metrics exposes omnimem_llm_calls_total{call} and omnimem_llm_tokens_total{call,kind} (same gauge-from-Valkey pattern as the tool metrics, subject to METRICS_CACHE_TTL).
  • A Valkey failure while recording is logged and never blocks ingest. scripts/summary_thinking_compare.py disables the sink so comparisons do not pollute production counters.
  • Release bump to 6.9.1 (pyproject.toml, memory/version.py, CHANGELOG), docs row in docs/configuration.md.

Notes

  • Requires the web UI to scrape (optional by design); recording happens either way. No history before first deploy.
  • Grafana: rate(omnimem_llm_tokens_total{kind="output"}[1h]) by call; cache hit ratio from cache_read vs input.

Local checks (run before push)

ruff check and format --check clean, ASCII grep clean, cd mcp_server && pytest tests: 2008 passed, 1 skipped.

🤖 Generated with Claude Code

## What - The RSS worker adds each Anthropic call's tokens to `meta:usage:<call>` hashes in Valkey (`summary`, `extract`, `score`): calls, input, cache_read, cache_creation, output. Cumulative, so `rate()` works across restarts. - The web UI's `/metrics` exposes `omnimem_llm_calls_total{call}` and `omnimem_llm_tokens_total{call,kind}` (same gauge-from-Valkey pattern as the tool metrics, subject to `METRICS_CACHE_TTL`). - A Valkey failure while recording is logged and never blocks ingest. `scripts/summary_thinking_compare.py` disables the sink so comparisons do not pollute production counters. - Release bump to 6.9.1 (pyproject.toml, memory/version.py, CHANGELOG), docs row in `docs/configuration.md`. ## Notes - Requires the web UI to scrape (optional by design); recording happens either way. No history before first deploy. - Grafana: `rate(omnimem_llm_tokens_total{kind="output"}[1h])` by `call`; cache hit ratio from `cache_read` vs `input`. ## Local checks (run before push) ruff check and format --check clean, ASCII grep clean, `cd mcp_server && pytest tests`: 2008 passed, 1 skipped. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Worker adds each call's tokens to meta:usage:<call> in Valkey; the web UI renders omnimem_llm_calls_total and omnimem_llm_tokens_total.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
release: 6.9.1
All checks were successful
Lint / Ruff (pull_request) Successful in 10s
Lint / ASCII only (pull_request) Successful in 3s
Security Scans / Bandit, dependency audit, secret scan (pull_request) Successful in 1m37s
Security Scans / Test Coverage (pull_request) Successful in 1m15s
3ae540ac21
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
tim merged commit 90bcaddf54 into develop 2026-10-15 10:48:25 +00:00
tim deleted branch feat/usage-metrics 2026-10-15 10:48:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
upstream-feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
tim/omnimem!14
No description provided.