Skip to main content

Gauge

The gauge panel displays a single numeric value as a visual gauge with configurable min/max bounds and color thresholds.

Properties

PropertyTypeDescription
minstringMinimum value (can be a number or CEL expression)
maxstringMaximum value (can be a number or CEL expression)
precisionintDecimal places to display
unitstringUnit label (e.g., "%", "pods")
thresholdsarrayColor thresholds based on percentage

Expected Columns

ColumnTypeDescription
valuenumberNumeric value to display (required)
labelstringOptional label; the panel title is used when omitted

Thresholds

Thresholds define colors at percentage breakpoints (0-100%):

PropertyTypeDescription
percentintPercentage at which this threshold applies
colorstringColor name or hex code (e.g., "green", "#10b981")

Example

gauge.yaml
apiVersion: 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