Skip to content

feat(logs): filter by minimum severity - #269

Open
vmax wants to merge 1 commit into
thejefflarson:mainfrom
vmax:feat/logs-min-severity
Open

vmax wants to merge 1 commit into
thejefflarson:mainfrom
vmax:feat/logs-min-severity

Conversation

@vmax

@vmax vmax commented Nov 15, 2026

Copy link
Copy Markdown

Closes #268.

What

  • API: GET /api/logs takes an optional min_severity — an inclusive lower bound on the OTel severity_number (5 DEBUG, 9 INFO, 13 WARN, 17 ERROR, 21 FATAL). Rows with a NULL severity are excluded when it's set; omitting it keeps today's behavior.
  • MCP: query_logs gets the same min_severity arg (plumbed into the shared api::query_logs).
  • UI: a select next to the body/attribute filters — any severity / debug+ / info+ / warn+ / error+ / fatal — styled with the existing .filters select rule, so no new CSS.

No migration: the query is already bounded by the time window (and logs_service_time_idx when a service is set), so the severity predicate is just a row filter on top.

Tests

  • New logs_min_severity_filter smoke test: inclusive floor (WARN → WARN+ERROR, ERROR → ERROR), composes with q, NULL-severity rows excluded only when filtering.
  • cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test against a local Postgres; npm run lint, npm test, npm run build.
  • Checked by hand against a running server fed by an OTel Python SDK: min_severity=9 → INFO+ERROR, min_severity=17 → ERROR only.

(Side note: rollup_vacuum_health_canary_… fails locally against a long-lived dev DB where autovacuum has already run — same on main, unrelated to this change; it passes on a fresh DB like CI's.)

🤖 Generated with Claude Code

Add an optional `min_severity` (OTel severity_number, inclusive lower
bound) to GET /api/logs and the MCP `query_logs` tool, and a severity
select (any / debug+ / info+ / warn+ / error+ / fatal) next to the log
filters in the UI. Logs without a severity are excluded when the filter
is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs: filter by severity

1 participant