diff --git a/client/src/components/podRamChart.tsx b/client/src/components/podRamChart.tsx index f9fe6f7..3ce3160 100644 --- a/client/src/components/podRamChart.tsx +++ b/client/src/components/podRamChart.tsx @@ -5,11 +5,14 @@ import {parseRam, TO_GB} from '../utils/unitHelpers'; import {Pod, Metrics} from '../utils/types'; import PrometheusGraph from '../views/prometheusgraph'; -export default function RamChart({items, metrics}: {items?: Pod[], metrics?: _.Dictionary}) { +export default function RamChart({items, metrics, pod}: {items?: Pod[], metrics?: _.Dictionary, pod?: Pod}) { const totals = getPodRamTotals(items, metrics); + const defaultLabels = "unit='byte'"; + const labelMatchers = pod ? `${defaultLabels}, pod="${pod.metadata.name}"` : defaultLabels; + const query = { - queryString: `sum(kube_pod_container_resource_requests{unit="byte"}/${TO_GB})`, + queryString: `sum(kube_pod_container_resource_requests{${labelMatchers}}/${TO_GB})`, title: 'Pod Memory Usage', yAxisMin: 0, yAxisUnit: 'GiB', diff --git a/client/src/views/pod.tsx b/client/src/views/pod.tsx index 0183c01..595a2fc 100644 --- a/client/src/views/pod.tsx +++ b/client/src/views/pod.tsx @@ -83,7 +83,7 @@ export default class PodView extends Base { - +