Gauge
The gauge panel displays a single numeric value as a visual gauge with configurable min/max bounds and color thresholds.
Properties
| Property | Type | Description |
|---|---|---|
min | string | Minimum value (can be a number or CEL expression) |
max | string | Maximum value (can be a number or CEL expression) |
precision | int | Decimal places to display |
unit | string | Unit label (e.g., "%", "pods") |
thresholds | array | Color thresholds based on percentage |
Expected Columns
| Column | Type | Description |
|---|---|---|
value | number | Numeric value to display (required) |
label | string | Optional label; the panel title is used when omitted |
Thresholds
Thresholds define colors at percentage breakpoints (0-100%):
| Property | Type | Description |
|---|---|---|
percent | int | Percentage at which this threshold applies |
color | string | Color name or hex code (e.g., "green", "#10b981") |
Example
gauge.yamlapiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: gauge
namespace: mc
spec:
display:
title: Gauge Panel Example
sidebar: true
queries:
pods:
configs:
types:
- "Kubernetes::Pod"
panels:
- name: Pods
description: Percentage of Unhealthy Pods
type: gauge
gauge:
unit: " %"
thresholds:
- percent: 0
color: green
- percent: 60
color: orange
- percent: 90
color: red
query: |
SELECT
COALESCE(
(SELECT COUNT(*) FROM pods WHERE health = 'unhealthy') * 100.0 / NULLIF((SELECT COUNT(*) FROM pods), 0),
0
) AS value