You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/backend.ai-webui-docs/src/en/admin_menu/admin_menu.md
+83Lines changed: 83 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -404,6 +404,89 @@ Click the edit icon next to the model card name to modify an existing model card
404
404
405
405
You can delete an individual model card by clicking the delete icon next to its name, or perform bulk deletion by selecting multiple model cards with the row checkboxes and clicking the red trash-bin button next to the selection count.
406
406
407
+
<a id="prometheus-query-presets"></a>
408
+
409
+
## Prometheus Query Presets
410
+
411
+
Backend.AI lets administrators define reusable **Prometheus query presets** that auto-scaling rules and other monitoring features can reference by name. A preset bundles a metric name, a PromQL query template, an optional time window, and optional filter / group labels so operators do not have to retype the same query for every rule.
412
+
413
+
The presets are managed from the **Prometheus Preset** tab on the Admin Serving page (`/admin-deployments?tab=prometheus-preset`).
414
+
415
+

416
+
<!-- TODO: Capture screenshot of the Prometheus Query Preset list -->
417
+
418
+
:::note
419
+
This tab is **admin-only** and is visible only when the Backend.AI Manager advertises the `prometheus-query-preset` capability. If the tab does not appear in your environment, your Manager build does not yet support this feature.
420
+
:::
421
+
422
+
<a id="prometheus-preset-list-and-filter"></a>
423
+
424
+
### List & Filter
425
+
426
+
The preset table lists all Prometheus query presets across the cluster. Each row shows:
427
+
428
+
- **Name**: A unique, human-readable identifier for the preset. The cell also exposes inline **Edit** and **Delete** actions.
429
+
- **ID**: The preset's internal identifier.
430
+
- **Metric Name**: The metric this preset reports (used as the display label by consumers such as auto-scaling rules).
431
+
- **Query Template**: The PromQL expression that will be executed. The cell is **copyable** — hover over the value and click the copy icon to copy the full template to the clipboard. This is useful when you want to paste the template into a Prometheus UI to verify the result.
432
+
- **Time Window**: The default look-back window (for example, `5m`) used when the query references a range vector.
433
+
- **Category**: The optional category the preset belongs to (with the resolved category name and the category ID).
434
+
- **Options**: The optional **Filter Labels** and **Group Labels** that consumers can apply on top of the preset.
435
+
- **Created At** / **Updated At**: Timestamps maintained automatically by the server.
436
+
437
+
You can search and narrow the list with the property filter above the table, and click any column header to change the sort order.
438
+
439
+
<a id="prometheus-preset-column-settings"></a>
440
+
441
+
### Column Settings Persistence
442
+
443
+
The table includes a column-settings control that lets you hide columns you do not need and reorder the visible columns. Your choices are **persisted across sessions** per browser, so the table opens with your preferred layout the next time you visit the tab. Resetting the column settings restores the default Backend.AI layout.
444
+
445
+
<a id="prometheus-preset-create"></a>
446
+
447
+
### Create a Preset
448
+
449
+
Click **Add Preset** at the top right of the table to open the **Create Preset** modal.
<!-- TODO: Capture screenshot of the Create Preset modal with the live preview area visible -->
453
+
454
+
The modal contains the following fields:
455
+
456
+
- **Name**: The preset's unique name. Must be unique across all Prometheus query presets.
457
+
- **Description**: A free-form description shown alongside the preset in selectors.
458
+
- **Category**: An optional category for grouping related presets. Leave empty for **No category**.
459
+
- **Metric Name**: The metric label that consumers (for example, auto-scaling rules) will display.
460
+
- **Query Template**: The PromQL expression to execute. As you type, a **live preview** area below the field calls the server's `adminPrometheusQueryPresetPreview` query and shows the current value the query returns against your Prometheus instance, so you can verify the template works before saving. The preview is debounced and updates automatically as you edit.
461
+
- **Time Window**: The default range-vector window, for example `5m`. Leave empty if the query does not use a range vector.
462
+
- **Filter Labels**: Optional list of label selectors that consumers can apply on top of the preset.
463
+
- **Group Labels**: Optional list of labels to group the query result by.
464
+
465
+
Click **Create** to save the preset. On success, the preset appears in the list and a confirmation toast is shown.
466
+
467
+
<a id="prometheus-preset-edit"></a>
468
+
469
+
### Edit a Preset
470
+
471
+
Click the **Edit** action in the **Name** cell of a preset row to open the **Edit Preset** modal. The modal is pre-populated with the preset's current values and exposes the same fields as the Create dialog, including the live preview area for the Query Template.
<!-- TODO: Capture screenshot of the Edit Preset modal with the live preview reflecting the current template -->
475
+
476
+
Click **Save** to apply your changes. Consumers of the preset (for example, auto-scaling rules referencing it) automatically pick up the new query template the next time they evaluate the metric.
477
+
478
+
<a id="prometheus-preset-delete"></a>
479
+
480
+
### Delete a Preset
481
+
482
+
Click the **Delete** action in the **Name** cell of a preset row to open the deletion confirmation modal.
483
+
484
+
:::danger
485
+
Deleting a Prometheus query preset is **permanent and cannot be undone**. Auto-scaling rules and other features that reference the deleted preset will lose their query template and may stop functioning until they are reconfigured to point at a different preset.
486
+
:::
487
+
488
+
Because deletion is irreversible, the dialog requires you to **type the preset's name** into the confirmation input before the **Delete** button becomes enabled. This typed-confirmation pattern (`BAIConfirmModalWithInput`) is used consistently across Backend.AI for permanent-delete actions. Type the exact preset name shown in the dialog title and click **Delete** to confirm.
0 commit comments