Skip to main content

Gauge

The gauge column type displays numeric values as visual gauges with configurable thresholds and colors.

FieldDescriptionScheme
gauge*

Gauge visualization configuration

object

name*

Column name (must be a valid SQL identifier)

string

type*

Data type that controls formatting and visualization

string | number | boolean | datetime | duration | health | status | gauge | bytes | decimal | millicore | config_item | labels | badge

gauge.max

Maximum value for the gauge range (number or CEL expression)

string

gauge.min

Minimum value for the gauge range (number or CEL expression, e.g. row.memory_limit)

string

gauge.precision

Number of decimal places to display

integer

gauge.thresholds[].color

Color at this threshold (name or hex, e.g. green, #ef4444)

string

gauge.thresholds[].percent

Percentage of the range at which this threshold applies (0–100)

integer

badge

Badge styling configuration. Use color.auto for heuristic coloring or color.map for explicit value-to-color mappings.

BadgeConfig

card.position

Where this column appears in the card layout: title, subtitle, deck, body, footer, or headerRight

string

card.useForAccent

Set to true to use this column's value as the accent color for the card (typically used on health or status columns)

boolean

description

Human-readable help text for the column

string

filter

Enable server-side filtering for this column. Set filter.type: multiselect to let users include or exclude values without re-running the query.

object

hidden

Hide the column from the table view (default: false)

boolean

icon

CEL expression that resolves to an icon name per row (e.g. row.type)

string

primaryKey

Whether this column is part of the primary key (default: false). At least one column must be marked as primary key.

boolean

unit

Unit label appended to the displayed value (e.g. %, MB, pods)

string

url

Link to a config, another view, or a custom URL using CEL / Go templates

ColumnURL

width

Display width, e.g. 150px or a flex weight like 2

string

Example

namespace.yaml
apiVersion: mission-control.flanksource.com/v1
kind: View
metadata:
name: namespace
namespace: mc
spec:
columns:
- cardPosition: title
name: name
primaryKey: true
type: config_item
url:
config: row.id
- cardPosition: deck
filter:
type: multiselect
icon: row.health
name: status
type: status
- filter:
type: multiselect
hidden: true
name: health
type: health
- cardPosition: deck
description: Memory usage
gauge:
max: row.memory_limit
thresholds:
- color: green
percent: 0
- color: orange
percent: 75
- color: red
percent: 90
name: memory
type: gauge
unit: bytes
- cardPosition: deck
gauge:
max: row.cpu_limit
thresholds:
- color: "#8BC34A"
percent: 0
- color: "#F4B23C"
percent: 70
- color: "#F25C54"
percent: 85
name: cpu
type: gauge
unit: millicore
- cardPosition: footer
name: updated
type: datetime
- cardPosition: footer
name: created
type: datetime
- cardPosition: body
hidden: true
name: image
type: string
- cardPosition: body
hidden: true
name: node
type: string
description: View for inspecting a Kubernetes Namespace
display:
icon: namespace
plugins:
- configTab:
types:
- Kubernetes::Namespace
variables:
cluster: $(.config.tags.cluster)
namespace: $(.config.name)
sidebar: true
title: Namespace
mapping:
created: row.created_at
image: |
has(row.config) ? row.config.JSON().spec.containers[0].image : "N/A"
node: |
has(row.config) ? (has(row.config.JSON().spec.nodeName) ? row.config.JSON().spec.nodeName : "N/A"): "N/A"
updated: row.updated_at
merge: |
"SELECT
pod.id,
pod.name,
json_extract(pod.tags, '$.namespace')
AS namespace,
pod.status,
pod.health,
pod.config,
pod.created_at,
pod.updated_at,
memory.value as memory,
to_bytes(COALESCE(
json_extract(pod.config,
'$.spec.containers[0].resources.limits.memory'),
''
)) AS memory_limit,
cpu.value as cpu,
to_millicores(COALESCE(
json_extract(pod.config, '$.spec.containers[0].resources.limits.cpu'),

''
)) AS cpu_limit\nFROM pod\nLEFT JOIN memory
ON pod.name = memory.pod

AND json_extract(pod.tags, '$.namespace') = memory.namespace\nLEFT JOIN cpu
ON pod.name = cpu.pod
AND json_extract(pod.tags, '$.namespace') = cpu.namespace\nORDER
BY namespace, name
"
panels:
- description: Total Pods in the namespace
name: Total Pods
query: SELECT COUNT(*) AS value FROM pod
type: number
queries:
cpu:
columns:
namespace: string
pod: string
value: decimal
prometheus:
bearer: {}
connection: connection://mc/prometheus
oauth:
clientID: {}
clientSecret: {}
password: {}
query: |
sum by (namespace, pod) (
irate(container_cpu_usage_seconds_total{
container!="POD", # Skip The pause/infra container
image!="" # Skip dead containers
}[30s])
) * 1000
tls:
ca: {}
cert: {}
key: {}
username: {}
memory:
columns:
namespace: string
pod: string
value: decimal
prometheus:
bearer: {}
connection: connection://mc/prometheus
oauth:
clientID: {}
clientSecret: {}
password: {}
query: |
sum by (namespace, pod) (
container_memory_working_set_bytes{
container!="POD", # Skip The pause/infra container
image!="" # Skip dead containers
}
)
tls:
ca: {}
cert: {}
key: {}
username: {}
memory_usage:
columns:
namespace: string
pod: string
value: decimal
prometheus:
bearer: {}
connection: connection://mc/prometheus
oauth:
clientID: {}
clientSecret: {}
password: {}
query: |
sum(rate(container_memory_working_set_bytes{namespace=~"$(.var.namespace)", image!=""}[5m])) / sum(machine_memory_bytes{})
tls:
ca: {}
cert: {}
key: {}
username: {}
pod:
configs:
agent: all
tagSelector: cluster=$(.var.cluster),namespace=$(.var.namespace)
types:
- Kubernetes::Pod
templating:
- key: cluster
label: Cluster
valueFrom:
config:
types:
- Kubernetes::Cluster
- dependsOn:
- cluster
key: namespace
label: Namespace
valueFrom:
config:
tagSelector: cluster=$(.var.cluster)
types:
- Kubernetes::Namespace
status: {}