Skip to content
Open
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
80 changes: 80 additions & 0 deletions packages/backend.ai-webui-docs/src/en/admin_menu/admin_menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,86 @@ Click the edit icon next to the model card name to modify an existing model card

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.

<a id="prometheus-query-presets"></a>

## Prometheus Query Presets

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.

The presets are managed from the **Prometheus Preset** tab on the Admin Deployments page (`/admin-deployments?tab=prometheus-preset`).

![](../images/admin_prometheus_preset_list.png)

:::note
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.
:::

<a id="prometheus-preset-list-and-filter"></a>

### List & Filter

The preset table lists all Prometheus query presets across the cluster. Each row shows:

- **Name**: A unique, human-readable identifier for the preset. The cell also exposes inline **Edit** and **Delete** actions.
- **ID**: The preset's internal identifier.
- **Metric Name**: The metric this preset reports (used as the display label by consumers such as auto-scaling rules).
- **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.
- **Time Window**: The default look-back window (for example, `5m`) used when the query references a range vector.
- **Category**: The optional category the preset belongs to (with the resolved category name and the category ID).
- **Options**: The optional **Filter Labels** and **Group Labels** that consumers can apply on top of the preset.
- **Created At** / **Updated At**: Timestamps maintained automatically by the server.

You can search and narrow the list with the property filter above the table, and click any column header to change the sort order.

<a id="prometheus-preset-column-settings"></a>

### Column Settings Persistence

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.

<a id="prometheus-preset-create"></a>

### Create a Preset

Click **Add Preset** at the top right of the table to open the **Create Preset** modal.

![](../images/admin_prometheus_preset_create_modal.png)

The modal contains the following fields:

- **Name**: The preset's unique name. Must be unique across all Prometheus query presets.
- **Description**: A free-form description shown alongside the preset in selectors.
- **Category**: An optional category for grouping related presets. Leave empty for **No category**.
- **Metric Name**: The metric label that consumers (for example, auto-scaling rules) will display.
- **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.
- **Time Window**: The default range-vector window, for example `5m`. Leave empty if the query does not use a range vector.
- **Filter Labels**: Optional list of label selectors that consumers can apply on top of the preset.
- **Group Labels**: Optional list of labels to group the query result by.

Click **Create** to save the preset. On success, the preset appears in the list and a confirmation toast is shown.

<a id="prometheus-preset-edit"></a>

### Edit a Preset

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.

![](../images/admin_prometheus_preset_edit_modal.png)

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.

<a id="prometheus-preset-delete"></a>

### Delete a Preset

Click the **Delete** action in the **Name** cell of a preset row to open the deletion confirmation modal.

:::danger
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.
:::

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.

<a id="manage-resource-policy"></a>

## Manage Resource Policies
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions packages/backend.ai-webui-docs/src/ja/admin_menu/admin_menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,86 @@ models:

モデルカード名の横にある削除アイコンをクリックして個別のモデルカードを削除するか、行のチェックボックスで複数のモデルカードを選択したうえで、選択件数の横にある赤色のゴミ箱ボタンをクリックして一括削除を実行できます。

<a id="prometheus-query-presets"></a>

## Prometheusプリセット

Backend.AI では、管理者が再利用可能な **Prometheus クエリプリセット** を定義でき、オートスケーリングルールなどの監視機能から名前で参照できます。1 つのプリセットには、メトリクス名、PromQL クエリテンプレート、任意の時間ウィンドウ、任意のフィルタ/グループラベルがまとめられているため、運用者が同じクエリをルールごとに入力し直す必要はありません。

プリセットは、管理者デプロイページの **Prometheusプリセット** タブ(`/admin-deployments?tab=prometheus-preset`)から管理します。

![](../images/admin_prometheus_preset_list.png)

:::note
このタブは **管理者専用** で、Backend.AI マネージャーが `prometheus-query-preset` 機能をサポートしている場合にのみ表示されます。お使いの環境でタブが表示されない場合、マネージャービルドがまだこの機能をサポートしていません。
:::

<a id="prometheus-preset-list-and-filter"></a>

### 一覧とフィルタ

プリセットテーブルには、クラスタ全体に登録されたすべての Prometheus クエリプリセットが表示されます。各行には次の情報が含まれます。

- **名前**: プリセットを識別するための一意で人間が読みやすい名前です。このセルでは、インラインの **編集** および **削除** アクションも利用できます。
- **ID**: プリセットの内部識別子です。
- **メトリクス名**: このプリセットが報告するメトリクスで、オートスケーリングルールなどのコンシューマーが表示ラベルとして使用します。
- **クエリテンプレート**: 実行される PromQL 式です。セルは **コピー可能** で、値にホバーしてコピーアイコンをクリックすると、テンプレート全体をクリップボードにコピーできます。Prometheus UI にテンプレートを貼り付けて結果を確認したい場合に便利です。
- **時間ウィンドウ**: クエリがレンジベクタを参照する場合に使用される既定のルックバック期間(例: `5m`)です。
- **カテゴリ**: プリセットが属する任意のカテゴリ(解決されたカテゴリ名とカテゴリ ID が併せて表示されます)。
- **オプション**: コンシューマーがプリセットに対して追加で適用できる **フィルタラベル** と **グループラベル** です。
- **作成日時** / **更新日時**: サーバーが自動的に管理するタイムスタンプです。

テーブル上部のプロパティフィルタで一覧を検索・絞り込みでき、任意の列見出しをクリックすることで並び順を変更できます。

<a id="prometheus-preset-column-settings"></a>

### 列設定の保持

テーブルには、不要な列を非表示にしたり表示する列の順序を変更したりできる列設定コントロールが含まれています。選択した設定は **ブラウザごとにセッションをまたいで保持** されるため、次にこのタブを訪れた際にも希望のレイアウトで開きます。列設定をリセットすると、Backend.AI の既定レイアウトに戻ります。

<a id="prometheus-preset-create"></a>

### プリセットを作成する

テーブル右上の **プリセットを追加** をクリックして **プリセットを作成** モーダルを開きます。

![](../images/admin_prometheus_preset_create_modal.png)

モーダルには次のフィールドがあります。

- **名前**: プリセットの一意の名前です。すべての Prometheus クエリプリセット間で一意である必要があります。
- **説明**: セレクタなどでプリセットと一緒に表示される自由記述の説明です。
- **カテゴリ**: 関連するプリセットをグループ化するための任意のカテゴリです。空のままにすると **カテゴリなし** になります。
- **メトリクス名**: コンシューマー(例: オートスケーリングルール)に表示されるメトリクスラベルです。
- **クエリテンプレート**: 実行する PromQL 式です。入力中、フィールドの下にある **ライブプレビュー** 領域がサーバーの `adminPrometheusQueryPresetPreview` クエリを呼び出し、現在のテンプレートが Prometheus インスタンスに対して返す値をその場で表示します。これにより、保存前にテンプレートが期待どおり動作することを確認できます。プレビューはデバウンス処理され、編集に応じて自動的に更新されます。
- **時間ウィンドウ**: レンジベクタに使用する既定のウィンドウ(例: `5m`)です。クエリがレンジベクタを使用しない場合は空のままにします。
- **フィルタラベル**: コンシューマーがプリセットに対して追加で適用できる任意のラベルセレクタのリストです。
- **グループラベル**: クエリ結果をグループ化するための任意のラベルのリストです。

**作成** をクリックしてプリセットを保存します。成功すると、プリセットが一覧に表示され、確認トーストが表示されます。

<a id="prometheus-preset-edit"></a>

### プリセットを編集する

プリセット行の **名前** セルにある **編集** アクションをクリックすると、**プリセットを編集** モーダルが開きます。モーダルにはプリセットの現在の値があらかじめ入力されており、クエリテンプレートのライブプレビュー領域を含めて作成ダイアログと同じフィールドが提供されます。

![](../images/admin_prometheus_preset_edit_modal.png)

**セーブ** をクリックして変更を適用します。プリセットを参照しているコンシューマー(例: オートスケーリングルール)は、次にメトリクスを評価する際に新しいクエリテンプレートを自動的に取り込みます。

<a id="prometheus-preset-delete"></a>

### プリセットを削除する

プリセット行の **名前** セルにある **削除** アクションをクリックすると、削除確認モーダルが開きます。

:::danger
Prometheus クエリプリセットの削除は **完全な削除であり、元に戻すことはできません**。削除されたプリセットを参照しているオートスケーリングルールなどはクエリテンプレートを失い、別のプリセットを参照するように再構成されるまで正常に動作しなくなる可能性があります。
:::

削除は元に戻せないため、ダイアログでは **削除** ボタンが有効になる前に確認入力欄に **プリセット名を入力する** 必要があります。この入力確認パターン(`BAIConfirmModalWithInput`)は、永続削除アクションに対して Backend.AI 全体で一貫して使用されています。ダイアログのタイトルに表示されているプリセット名を正確に入力し、**削除** をクリックして確定してください。

<a id="manage-resource-policy"></a>

## リソースポリシー管理
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading