Diagnose data source
Run a synchronous diagnostic query (log_patterns for Loki/VictoriaLogs, metric_trends for Prometheus). Used by Flashduty AI SRE for log-pattern clustering and time-series trend analysis. Long-running — up to 35 s.
Restrictions
| Aspect | Value |
|---|---|
| Rate limits | 600 requests/minute; 10 requests/second per account |
| Permissions | Any valid app_key (read-only; not gated by a specific permission class) |
Usage
- This is a diagnostic / RCA endpoint, not a raw data query — pair it with
/monit/query/rowswhen you need detailed rows. operationdefaults fromds_type:loki/victorialogs→log_patterns,prometheus→metric_trends. Other sources must passoperationexplicitly.methodsselects the analyses to run; when omitted,log_patternsdefaults topattern_snapshot + pattern_compare(previous_window)andmetric_trendsdefaults tosingle_window_shape + window_compare(previous_window).time_rangeis in Unix seconds; missing or invalid values default to the last 15 minutes; a window wider than 6 hours is rejected.- The request is forwarded over WebSocket to
monit-edge. Long-running: the request may take up to ~30 s on the edge side plus webapi overhead. Set client timeouts to at least 35 s. options.*are upper-bounded by edge (max_logs_scanned≤ 50 000,max_patterns≤ 50,examples_per_pattern≤ 3,step_seconds∈ [15, 300],max_series≤ 200,topk≤ 50,timeout_seconds≤ 30).- Two error layers as with
/monit/query/rows: edge-level execution errors come back as HTTP 200 with anerrorobject in the body — check both layers. - Log examples are basic-redacted before being returned; expect
warnings: ["examples redacted"]. Do not treat them as raw logs.
Authorizations
App key issued from the Flashduty console under Account → APP Keys. Required on every public API call. Keep it secret — it grants the same access as the owning account.
Body
Data source type. log_patterns supports loki and victorialogs; metric_trends supports prometheus.
Data source name configured under the tenant.
Optional consistency check. Must equal the authenticated account when supplied.
Diagnostic operation. When omitted, inferred from ds_type (loki / victorialogs → log_patterns, prometheus → metric_trends). Other sources must specify explicitly.
log_patterns, metric_trends Diagnostic window in Unix seconds. Defaults to the last 15 minutes when missing or invalid; windows wider than 6 hours are rejected.
Diagnostic methods to run. When omitted, log_patterns defaults to pattern_snapshot + pattern_compare(previous_window) and metric_trends defaults to single_window_shape + window_compare(previous_window).
Execution options, all upper-bounded by monit-edge.
Response
Success
Success response envelope. On every 2xx response, request_id identifies the call (also mirrored in the Flashcat-Request-Id header) and data holds the endpoint-specific payload. Failure responses use a different shape — see ErrorResponse.
Unique ID for this request. Mirrored in the Flashcat-Request-Id response header. Include it when reporting issues.
"01HK8XQE3Z7JM2NTFQ5YJ8P9R4"
Operation-specific diagnostic result. Inspect operation first, then results[]. The shape of results[].patterns (for log_patterns) vs results[].series (for metric_trends) differs by operation; the full schema is documented in the monit-webapi diagnose-api guide.