From ec6b37e1bf9cfde68b8de1caaf46cd8948656203 Mon Sep 17 00:00:00 2001 From: AntoineThebaud Date: Thu, 19 Dec 2024 15:27:44 +0100 Subject: [PATCH] Add 2nd panel to the gauge demo dac Signed-off-by: AntoineThebaud --- dac/SingleGauge/main.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dac/SingleGauge/main.go b/dac/SingleGauge/main.go index 41d3822..5148b03 100644 --- a/dac/SingleGauge/main.go +++ b/dac/SingleGauge/main.go @@ -41,6 +41,18 @@ func main() { query.PromQL("100 - ((node_memory_MemAvailable_bytes{env=\"demo\", instance=\"demo.do.prometheus.io:9100\"} * 100) / node_memory_MemTotal_bytes{env=\"demo\", instance=\"demo.do.prometheus.io:9100\"})"), ), ), + panelgroup.AddPanel("Second Gauge", + gauge.Chart( + gauge.Calculation(common.LastCalculation), + gauge.Format(common.Format{ + Unit: common.BytesUnit, + }), + gauge.Max(20), + ), + panel.AddQuery( + query.PromQL("100 - ((node_memory_MemAvailable_bytes{env=\"demo\", instance=\"demo.do.prometheus.io:9100\"} * 100) / node_memory_MemTotal_bytes{env=\"demo\", instance=\"demo.do.prometheus.io:9100\"})"), + ), + ), ), )