Skip to content

feat: Phase 2 - incidents, logs, monitor expansion, query compiler - #8

Merged
sounak98 merged 1 commit into
mainfrom
feat/phase-2-incidents-logs
Mar 5, 2026
Merged

sounak98 merged 1 commit into
mainfrom
feat/phase-2-incidents-logs

Conversation

@sounak98

@sounak98 sounak98 commented Mar 5, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Incidents (API v3): full CRUD with 8 subcommands (list, get, create, ack, resolve, escalate, delete, timeline) and colored status output
  • Monitor expansion: update with field-level edits, availability (SLA endpoint), response-times with nested region breakdown
  • Logs: sources via Telemetry API, sql raw ClickHouse queries, query with simple filter compiler, tail polling-based live tail
  • Query compiler: translates level:error AND status:>=500 to ClickHouse SQL with duration parsing, wildcards, numeric comparisons, AND/OR
  • Infrastructure: v3 HTTP helpers, shared parse_one/check_status, SqlClient with Basic auth, optional telemetry client in AppContext

New commands

bs incidents list/get/create/ack/resolve/escalate/delete/timeline
bs monitors update <id> --name/--url/--frequency/...
bs monitors availability <id> --from/--to
bs monitors response-times <id> --from/--to
bs logs sources
bs logs source <id>
bs logs sql "SELECT ..."
bs logs query "level:error" --source <table> --since 1h
bs logs tail --source <table> --since 5m

New files (8)

  • src/types/incident.rs, src/types/source.rs
  • src/adapters/http/incidents.rs, src/adapters/http/sql.rs, src/adapters/http/telemetry.rs
  • src/commands/incidents.rs, src/commands/logs.rs
  • src/query/mod.rs

Test plan

  • 9 new query compiler unit tests pass
  • 4 existing monitors integration tests pass
  • 8 existing output unit tests pass
  • make fmt && make check clean (no clippy warnings)
  • Manual testing of incidents commands against live API
  • Manual testing of logs commands with SQL credentials

…se 2)

Incidents (API v3): list, get, create, ack, resolve, escalate, delete,
timeline with colored status output (started/acknowledged/resolved).

Monitor expansion: update command with field-level edits, availability/SLA
endpoint, response-times with nested region breakdown.

Logs: sources listing via Telemetry API, raw SQL queries via ClickHouse
Query API with Basic auth, simple filter query compiler (level:error,
status:>=500, wildcards, AND/OR), and polling-based live tail.

Query compiler translates human filters to ClickHouse SQL with duration
parsing (1h, 30m, 7d), exact match, numeric comparison, wildcard, quoted
contains, and boolean combinators. Includes 9 unit tests.

Adds v3 HTTP helpers, shared parse_one/check_status, paginate_all_v3,
telemetry client factory, SqlClient with HTTP Basic auth, and optional
telemetry client in AppContext with env var override support.
@sounak98
sounak98 force-pushed the feat/phase-2-incidents-logs branch from 7872c71 to 1ec1996 Compare March 5, 2026 19:33
@sounak98
sounak98 merged commit 4357ccb into main Mar 5, 2026
4 checks passed
@github-actions github-actions Bot mentioned this pull request Mar 5, 2026
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.

1 participant