Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ jobs:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version: stable
# Follow the module's own Go, the way ci.yml already does. Chasing
# "stable" means every upstream Go release lands here unannounced,
# and golangci-lint is a prebuilt binary that can only parse source
# up to the Go it was built with: Go 1.27.0 going stable made v2.11
# (built with go1.26) panic with "file requires newer Go version",
# which is a repo-wide red on every open PR, triggered by nothing in
# the repo. Pinning to go.mod means lint only moves when we move.
go-version-file: "go.mod"
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
Expand Down
4 changes: 2 additions & 2 deletions internal/cli/monit_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ func newMonitQueryDiagnoseCmd() *cobra.Command {
},
}

cmd.Flags().StringVar(&dsType, "ds-type", "", "Datasource type: prometheus|victorialogs|loki|mysql (required)")
cmd.Flags().StringVar(&dsType, "ds-type", "", "Datasource type: loki|victorialogs (log_patterns) or prometheus (metric_trends) (required)")
cmd.Flags().StringVar(&dsName, "ds-name", "", "Datasource name as configured (required)")
registerEnumFlag(cmd, "ds-type", "prometheus", "victorialogs", "loki", "mysql")
registerEnumFlag(cmd, "ds-type", "prometheus", "victorialogs", "loki")
cmd.Flags().StringVar(&timeStart, "time-start", "15m", "Window start: relative duration ('15m'/'1h'), 'now', a date/RFC3339 timestamp, or a unix epoch in seconds or milliseconds")
cmd.Flags().StringVar(&timeEnd, "time-end", "now", "Window end: same formats as --time-start; span capped at 6h")
cmd.Flags().StringVar(&inputQuery, "input-query", "", "Filter-only log query OR matrix PromQL (required)")
Expand Down
2 changes: 1 addition & 1 deletion skills/flashduty/reference/monit-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Pre-clustered RCA findings (log_patterns or metric_trends)
- **`data` has no time flags** — putting `--time-start` on it is wrong; embed the range in `--expr` (or use `--delay-seconds` for the point-in-time lookback).
- Empty results = the query genuinely matched nothing in that window — report it, don't widen blindly.
- **`diagnose` rejects windows wider than 6 hours outright.** `--time-start`/`--time-end` span is capped at 6h server-side; the default window is the last 15 minutes (`--time-start 15m`, `--time-end now`). Widen within the cap, don't retry past it.
- **`--ds-type` on `diagnose` only accepts `prometheus`, `victorialogs`, `loki`, `mysql`.** `monit datasource-list` can return other types (e.g. `oracle`, `postgres`, `clickhouse`, `elasticsearch`, `sls`) — those are not supported here.
- **`diagnose` pairs one operation with one set of datasource types, and rejects every other combination server-side.** `log_patterns` takes `loki` or `victorialogs`; `metric_trends` takes `prometheus`. There is no third operation, so no other `--ds-type` value can succeed — `mysql`, `oracle`, `postgres`, `clickhouse`, `elasticsearch`, and `sls` all come back as an invalid-parameter error however you pair them. `monit datasource-list` returns those types because `data` supports them; `diagnose` does not.
- **Tunables and their caps**: `--max-logs` (default 10000, cap 50000), `--max-patterns` (default 20, cap 50), `--timeout-seconds` (default 25, cap 30).

## Worked example — log-pattern evidence in the last hour
Expand Down