Skip to content

Commit 384dd76

Browse files
authored
Merge pull request #157 from flashcatcloud/fix/monit-query-diagnose-dstype
fix(monit-query): diagnose never accepted mysql — drop it from flag and card
2 parents e64c7cf + cb4c778 commit 384dd76

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ jobs:
1717
- uses: actions/checkout@v7
1818
- uses: actions/setup-go@v7
1919
with:
20-
go-version: stable
20+
# Follow the module's own Go, the way ci.yml already does. Chasing
21+
# "stable" means every upstream Go release lands here unannounced,
22+
# and golangci-lint is a prebuilt binary that can only parse source
23+
# up to the Go it was built with: Go 1.27.0 going stable made v2.11
24+
# (built with go1.26) panic with "file requires newer Go version",
25+
# which is a repo-wide red on every open PR, triggered by nothing in
26+
# the repo. Pinning to go.mod means lint only moves when we move.
27+
go-version-file: "go.mod"
2128
- name: golangci-lint
2229
uses: golangci/golangci-lint-action@v9
2330
with:

internal/cli/monit_query.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ func newMonitQueryDiagnoseCmd() *cobra.Command {
6969
},
7070
}
7171

72-
cmd.Flags().StringVar(&dsType, "ds-type", "", "Datasource type: prometheus|victorialogs|loki|mysql (required)")
72+
cmd.Flags().StringVar(&dsType, "ds-type", "", "Datasource type: loki|victorialogs (log_patterns) or prometheus (metric_trends) (required)")
7373
cmd.Flags().StringVar(&dsName, "ds-name", "", "Datasource name as configured (required)")
74-
registerEnumFlag(cmd, "ds-type", "prometheus", "victorialogs", "loki", "mysql")
74+
registerEnumFlag(cmd, "ds-type", "prometheus", "victorialogs", "loki")
7575
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")
7676
cmd.Flags().StringVar(&timeEnd, "time-end", "now", "Window end: same formats as --time-start; span capped at 6h")
7777
cmd.Flags().StringVar(&inputQuery, "input-query", "", "Filter-only log query OR matrix PromQL (required)")

skills/flashduty/reference/monit-query.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Pre-clustered RCA findings (log_patterns or metric_trends)
6363
- **`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).
6464
- Empty results = the query genuinely matched nothing in that window — report it, don't widen blindly.
6565
- **`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.
66-
- **`--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.
66+
- **`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.
6767
- **Tunables and their caps**: `--max-logs` (default 10000, cap 50000), `--max-patterns` (default 20, cap 50), `--timeout-seconds` (default 25, cap 30).
6868

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

0 commit comments

Comments
 (0)