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
| 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., "%", "bytes") |
group | string | Name of a group. When multiple bargauges have the same group, they are placed together. This is useful when each bar needs different properties. |
format | string | Display format: percentage or multiplier |
thresholds | array | Color thresholds based on percentage |
Expected Columns
| Column | Type | Description |
|---|---|---|
value | number | Numeric value for each bar (required) |
name or first non-value column | string | Bar label (required) |
Thresholds
Thresholds define colors at percentage breakpoints:
| Property | Type | Description |
|---|---|---|
percent | int | Percentage at which this threshold applies |
color | string | Color name or hex code (e.g., "#10b981") |
Example
bargauge.yamlapiVersion: 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