|
5923 | 5923 | "items": { |
5924 | 5924 | "$ref": "#/components/schemas/InvestigationTarget" |
5925 | 5925 | }, |
| 5926 | + "maxItems": 20, |
5926 | 5927 | "description": "Drill-down entries linked from the alert event detail page; at most 20 items, duplicates rejected. On update the field is presence-based: omit it to keep the current value, pass `[]` to clear.", |
5927 | 5928 | "x-flashduty-preserve-absence": true |
5928 | 5929 | }, |
|
6223 | 6224 | }, |
6224 | 6225 | "InvestigationTarget": { |
6225 | 6226 | "type": "object", |
6226 | | - "description": "Drill-down entry linked to alert events. A deliberately closed tagged union: new kinds require explicit server support.", |
| 6227 | + "description": "Alert-event drill-down entry. A deliberately closed tagged union: new kinds require explicit server support, and unknown fields inside a target are rejected.", |
6227 | 6228 | "properties": { |
6228 | 6229 | "kind": { |
6229 | 6230 | "type": "string", |
6230 | 6231 | "enum": [ |
6231 | | - "dashboard" |
| 6232 | + "dashboard", |
| 6233 | + "query" |
6232 | 6234 | ], |
6233 | | - "description": "Entry type; currently only `dashboard` is supported." |
| 6235 | + "description": "Entry kind: `dashboard` opens a dashboard panel, `query` opens an Explore query. It decides whether `dashboard` or `query` must be supplied; supplying the other one is rejected." |
| 6236 | + }, |
| 6237 | + "time_range": { |
| 6238 | + "$ref": "#/components/schemas/InvestigationTimeRange", |
| 6239 | + "description": "Window around the event time, required on every saved entry. A zero-length window is rejected; defaults belong to the editor." |
| 6240 | + }, |
| 6241 | + "query": { |
| 6242 | + "$ref": "#/components/schemas/QueryInvestigationTarget", |
| 6243 | + "description": "Configuration for the `query` kind; required when `kind` is `query`, and rejected when `kind` is `dashboard`." |
6234 | 6244 | }, |
6235 | 6245 | "dashboard": { |
6236 | 6246 | "$ref": "#/components/schemas/DashboardInvestigationTarget", |
6237 | 6247 | "description": "Configuration for the `dashboard` kind; required when `kind` is `dashboard`." |
6238 | 6248 | } |
6239 | 6249 | }, |
6240 | 6250 | "required": [ |
6241 | | - "kind" |
| 6251 | + "kind", |
| 6252 | + "time_range" |
6242 | 6253 | ] |
6243 | 6254 | }, |
6244 | 6255 | "DashboardInvestigationTarget": { |
|
6253 | 6264 | "type": "string", |
6254 | 6265 | "description": "Panel ID inside the dashboard; must be a canonical UUIDv7. Optional." |
6255 | 6266 | }, |
6256 | | - "variable_bindings": { |
| 6267 | + "variables": { |
6257 | 6268 | "type": "object", |
6258 | 6269 | "additionalProperties": { |
6259 | | - "$ref": "#/components/schemas/InvestigationVariableBinding" |
| 6270 | + "type": "string" |
6260 | 6271 | }, |
6261 | | - "description": "Dashboard variable bindings, keyed by dashboard variable name." |
| 6272 | + "description": "Dashboard variable values, keyed by variable name. Values may reference event labels through `{{ }}` templates; defaults to an empty object." |
| 6273 | + } |
| 6274 | + }, |
| 6275 | + "required": [ |
| 6276 | + "dashboard_id", |
| 6277 | + "variables" |
| 6278 | + ] |
| 6279 | + }, |
| 6280 | + "InvestigationTimeRange": { |
| 6281 | + "type": "object", |
| 6282 | + "description": "Window around the alert event time, expressed as two offsets. Both directions must be non-negative and at least one must be greater than zero, so an entry never resolves to an empty window.", |
| 6283 | + "properties": { |
| 6284 | + "before_seconds": { |
| 6285 | + "type": "integer", |
| 6286 | + "format": "int64", |
| 6287 | + "minimum": 0, |
| 6288 | + "maximum": 9007199254740, |
| 6289 | + "description": "Seconds to look back from the event time." |
| 6290 | + }, |
| 6291 | + "after_seconds": { |
| 6292 | + "type": "integer", |
| 6293 | + "format": "int64", |
| 6294 | + "minimum": 0, |
| 6295 | + "maximum": 9007199254740, |
| 6296 | + "description": "Seconds to look forward from the event time, so behaviour after the event stays visible." |
6262 | 6297 | } |
6263 | 6298 | }, |
6264 | 6299 | "required": [ |
6265 | | - "dashboard_id" |
| 6300 | + "before_seconds", |
| 6301 | + "after_seconds" |
6266 | 6302 | ] |
6267 | 6303 | }, |
6268 | | - "InvestigationVariableBinding": { |
| 6304 | + "QueryInvestigationTarget": { |
6269 | 6305 | "type": "object", |
6270 | | - "description": "Binding between a dashboard variable and alert event data.", |
| 6306 | + "description": "Explore query used by a `query` drill-down entry. The expression may reference event labels through `{{ }}` templates, while `args` values may not.", |
6271 | 6307 | "properties": { |
6272 | | - "source": { |
| 6308 | + "datasource_id": { |
| 6309 | + "type": "integer", |
| 6310 | + "format": "int64", |
| 6311 | + "minimum": 1, |
| 6312 | + "maximum": 9007199254740991, |
| 6313 | + "description": "Data source the query runs against." |
| 6314 | + }, |
| 6315 | + "query": { |
| 6316 | + "$ref": "#/components/schemas/DashboardQuery", |
| 6317 | + "description": "Query payload." |
| 6318 | + } |
| 6319 | + }, |
| 6320 | + "required": [ |
| 6321 | + "datasource_id", |
| 6322 | + "query" |
| 6323 | + ] |
| 6324 | + }, |
| 6325 | + "DashboardQuery": { |
| 6326 | + "type": "object", |
| 6327 | + "description": "Query payload shared by dashboards and drill-down entries.", |
| 6328 | + "properties": { |
| 6329 | + "mode": { |
6273 | 6330 | "type": "string", |
6274 | 6331 | "enum": [ |
6275 | | - "event_label" |
| 6332 | + "instant", |
| 6333 | + "range", |
| 6334 | + "window" |
6276 | 6335 | ], |
6277 | | - "description": "Where the bound value comes from; currently only `event_label` (the alert event's label value) is supported." |
| 6336 | + "description": "Evaluation mode: `instant` evaluates at a single timestamp, `range` evaluates a stepped series, `window` returns raw rows inside a time window." |
6278 | 6337 | }, |
6279 | | - "key": { |
| 6338 | + "expr": { |
6280 | 6339 | "type": "string", |
6281 | | - "description": "Alert event label name; must follow Prometheus label naming rules and must not be a reserved label." |
| 6340 | + "description": "Query expression in the target data source's language. May reference event labels through `{{ }}` templates." |
| 6341 | + }, |
| 6342 | + "args": { |
| 6343 | + "type": "object", |
| 6344 | + "additionalProperties": { |
| 6345 | + "type": "string" |
| 6346 | + }, |
| 6347 | + "description": "Named query arguments; defaults to an empty object. Values are passed through verbatim and must not contain `{{ }}` templates." |
| 6348 | + }, |
| 6349 | + "min_step_seconds": { |
| 6350 | + "type": [ |
| 6351 | + "integer", |
| 6352 | + "null" |
| 6353 | + ], |
| 6354 | + "format": "int64", |
| 6355 | + "minimum": 1, |
| 6356 | + "maximum": 9007199254740, |
| 6357 | + "description": "Minimum step, in seconds. Only accepted when `mode` is `range`, and must be greater than zero; omit or pass null to let the server decide." |
6282 | 6358 | } |
6283 | 6359 | }, |
6284 | 6360 | "required": [ |
6285 | | - "source", |
6286 | | - "key" |
| 6361 | + "mode", |
| 6362 | + "expr", |
| 6363 | + "args" |
6287 | 6364 | ] |
6288 | 6365 | } |
6289 | 6366 | } |
|
0 commit comments