Skip to main content

Bar Gauge

The bargauge panel displays multiple values as horizontal bars with configurable thresholds. Useful for comparing related metrics like CPU real usage vs requests vs limits.

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., "%", "bytes")
groupstringName of a group. When multiple bargauges have the same group, they are placed together. This is useful when each bar needs different properties.
formatstringDisplay format: percentage or multiplier
thresholdsarrayColor thresholds based on percentage

Expected Columns

ColumnTypeDescription
valuenumberNumeric value for each bar (required)
name or first non-value columnstringBar label (required)

Thresholds

Thresholds define colors at percentage breakpoints:

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

Example

bargauge.yaml
apiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: bargauge
namespace: mc
spec:
display:
title: Global CPU Usage
sidebar: true
queries:
cpu_usage:
configs:
types:
- "Kubernetes::Pod"
panels:
- name: Global CPU Usage
description: CPU usage showing real, requested, and limits
type: bargauge
bargauge:
min: "0"
max: "100"
unit: "%"
thresholds:
- percent: 0
color: "#10b981"
- percent: 50
color: "#eab308"
- percent: 80
color: "#ef4444"
query: |
SELECT 'Real' as name, 9.10 as value
UNION ALL
SELECT 'Requests' as name, 35.7 as value
UNION ALL
SELECT 'Limits' as name, 189.12 as value