Skip to content

Commit 0a1624c

Browse files
committed
feat(FR-2494): add Prometheus query result preview in editor modal (#6642)
Resolves #6642 (FR-2494) Blocked by lablup/backend.ai#11036 > [!NOTE] > Test Node: /serving/e21d2f21-028a-405b-b196-69736b7343b0 with 10.122.10.215 ## Summary - Add Prometheus query result preview in the auto-scaling rule editor modal - When a Prometheus preset is selected, an instant query result is displayed below the query template using `prometheusQueryPresetResult` API - Shows current metric value with a refresh button to re-fetch on demand - Handles multiple series results, empty results, loading (Suspense), and errors (ErrorBoundary) ## Changes - `react/src/components/AutoScalingRuleEditorModal.tsx`: Added `PrometheusPresetPreview` component using `useLazyLoadQuery` with `fetchKey` for manual refresh support - `resources/i18n/en.json`: Added i18n keys for preview UI (`CurrentValue`, `MultipleSeriesResult`, `NoDataAvailable`, `RefreshPreview`)
1 parent 15d6897 commit 0a1624c

27 files changed

Lines changed: 829 additions & 81 deletions

data/schema.graphql

Lines changed: 69 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,8 +1538,13 @@ enum AuditLogStatus
15381538
input AuditLogStatusFilter
15391539
@join__type(graph: STRAWBERRY)
15401540
{
1541+
equals: AuditLogStatus = null
1542+
15411543
"""The in field."""
15421544
in: [AuditLogStatus!] = null
1545+
1546+
"""Excludes exact status match."""
1547+
notEquals: AuditLogStatus = null
15431548
notIn: [AuditLogStatus!] = null
15441549
}
15451550

@@ -1673,7 +1678,7 @@ type AutoScalingRule implements Node
16731678
"""
16741679
prometheusQueryPresetId: ID
16751680
createdAt: DateTime!
1676-
lastTriggeredAt: DateTime!
1681+
lastTriggeredAt: DateTime
16771682
}
16781683

16791684
"""Added in 25.19.0. Connection for auto-scaling rules."""
@@ -1704,7 +1709,7 @@ input AutoScalingRuleFilter
17041709
@join__type(graph: STRAWBERRY)
17051710
{
17061711
createdAt: DateTimeFilter = null
1707-
lastTriggeredAt: DateTimeFilter = null
1712+
lastTriggeredAt: NullableDateTimeFilter = null
17081713
AND: [AutoScalingRuleFilter!] = null
17091714
OR: [AutoScalingRuleFilter!] = null
17101715
NOT: [AutoScalingRuleFilter!] = null
@@ -4859,8 +4864,6 @@ enum DeploymentStatus
48594864
SCALING @join__enumValue(graph: STRAWBERRY)
48604865
DEPLOYING @join__enumValue(graph: STRAWBERRY)
48614866
READY @join__enumValue(graph: STRAWBERRY)
4862-
DESTROYING @join__enumValue(graph: STRAWBERRY)
4863-
DESTROYED @join__enumValue(graph: STRAWBERRY)
48644867
STOPPING @join__enumValue(graph: STRAWBERRY)
48654868
STOPPED @join__enumValue(graph: STRAWBERRY)
48664869
}
@@ -4880,6 +4883,12 @@ input DeploymentStatusFilter
48804883
"""The in field."""
48814884
in: [DeploymentStatus!] = null
48824885
equals: DeploymentStatus = null
4886+
4887+
"""Excludes statuses in the list."""
4888+
notIn: [DeploymentStatus!] = null
4889+
4890+
"""Excludes exact status match."""
4891+
notEquals: DeploymentStatus = null
48834892
}
48844893

48854894
"""
@@ -6061,6 +6070,11 @@ type EntityRef implements Node
60616070

60626071
"""The resolved entity object."""
60636072
entity: EntityNode
6073+
6074+
"""
6075+
Added in UNRELEASED. The resolved scope object in which the entity is registered.
6076+
"""
6077+
scope: EntityNode
60646078
}
60656079

60666080
"""An edge in a connection."""
@@ -7448,8 +7462,13 @@ enum KernelV2Status
74487462
input KernelV2StatusFilter
74497463
@join__type(graph: STRAWBERRY)
74507464
{
7465+
equals: KernelV2Status = null
7466+
74517467
"""The in field."""
74527468
in: [KernelV2Status!] = null
7469+
7470+
"""Excludes exact status match."""
7471+
notEquals: KernelV2Status = null
74537472
notIn: [KernelV2Status!] = null
74547473
}
74557474

@@ -8035,6 +8054,9 @@ input LoginHistoryResultFilter
80358054

80368055
"""The in field."""
80378056
in: [LoginAttemptResult!] = null
8057+
8058+
"""Excludes exact result match."""
8059+
notEquals: LoginAttemptResult = null
80388060
notIn: [LoginAttemptResult!] = null
80398061
}
80408062

@@ -8137,6 +8159,9 @@ input LoginSessionStatusFilter
81378159

81388160
"""The in field."""
81398161
in: [LoginSessionStatus!] = null
8162+
8163+
"""Excludes exact status match."""
8164+
notEquals: LoginSessionStatus = null
81408165
notIn: [LoginSessionStatus!] = null
81418166
}
81428167

@@ -10913,6 +10938,19 @@ input NotificationRuleTypeFilter
1091310938
notIn: [NotificationRuleType!] = null
1091410939
}
1091510940

10941+
"""
10942+
Added in UNRELEASED. Filter for nullable datetime fields with IS NULL / IS NOT NULL support.
10943+
"""
10944+
input NullableDateTimeFilter
10945+
@join__type(graph: STRAWBERRY)
10946+
{
10947+
before: DateTime = null
10948+
after: DateTime = null
10949+
equals: DateTime = null
10950+
notEquals: DateTime = null
10951+
isNull: Boolean = null
10952+
}
10953+
1091610954
"""
1091710955
Added in 26.3.0. Display number format configuration for a resource slot type.
1091810956
"""
@@ -13681,6 +13719,12 @@ input ReplicaStatusFilter
1368113719
"""The in field."""
1368213720
in: [ReplicaStatus!] = null
1368313721
equals: ReplicaStatus = null
13722+
13723+
"""Excludes statuses in the list."""
13724+
notIn: [ReplicaStatus!] = null
13725+
13726+
"""Excludes exact status match."""
13727+
notEquals: ReplicaStatus = null
1368413728
}
1368513729

1368613730
"""Added in 25.4.0."""
@@ -16106,8 +16150,13 @@ enum SessionV2Status
1610616150
input SessionV2StatusFilter
1610716151
@join__type(graph: STRAWBERRY)
1610816152
{
16153+
equals: SessionV2Status = null
16154+
1610916155
"""The in field."""
1611016156
in: [SessionV2Status!] = null
16157+
16158+
"""Excludes exact status match."""
16159+
notEquals: SessionV2Status = null
1611116160
notIn: [SessionV2Status!] = null
1611216161
}
1611316162

@@ -16450,6 +16499,12 @@ input TrafficStatusFilter
1645016499
"""The in field."""
1645116500
in: [TrafficStatus!] = null
1645216501
equals: TrafficStatus = null
16502+
16503+
"""Excludes traffic statuses in the list."""
16504+
notIn: [TrafficStatus!] = null
16505+
16506+
"""Excludes exact traffic status match."""
16507+
notEquals: TrafficStatus = null
1645316508
}
1645416509

1645516510
"""Added in 26.4.2. UI rendering options."""
@@ -18896,9 +18951,14 @@ Added in 26.4.2. Filter for VFolder operation status enum fields. Supports in an
1889618951
input VFolderOperationStatusFilter
1889718952
@join__type(graph: STRAWBERRY)
1889818953
{
18954+
equals: VFolderOperationStatus = null
18955+
1889918956
"""The in field."""
1890018957
in: [VFolderOperationStatus!] = null
1890118958

18959+
"""Excludes exact status match."""
18960+
notEquals: VFolderOperationStatus = null
18961+
1890218962
"""Exclude statuses not in this list."""
1890318963
notIn: [VFolderOperationStatus!] = null
1890418964
}
@@ -18979,9 +19039,14 @@ Added in 26.4.2. Filter for VFolder usage mode enum fields. Supports in and not_
1897919039
input VFolderUsageModeFilter
1898019040
@join__type(graph: STRAWBERRY)
1898119041
{
19042+
equals: VFolderUsageMode = null
19043+
1898219044
"""The in field."""
1898319045
in: [VFolderUsageMode!] = null
1898419046

19047+
"""Excludes exact usage mode match."""
19048+
notEquals: VFolderUsageMode = null
19049+
1898519050
"""Exclude usage modes not in this list."""
1898619051
notIn: [VFolderUsageMode!] = null
1898719052
}

0 commit comments

Comments
 (0)