From e03c15ba84cb467574ac1dc1ae5a560af6bb9a9e Mon Sep 17 00:00:00 2001 From: martin-clementz Date: Tue, 24 Sep 2024 15:19:15 +0200 Subject: [PATCH] feat: adding new metric types --- varnishprom.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/varnishprom.go b/varnishprom.go index c79763e..19797ae 100644 --- a/varnishprom.go +++ b/varnishprom.go @@ -499,6 +499,13 @@ func main() { metric.LabelNames = []string{"backend", "director", "host", "type"} metric.LabelValues = []string{backend, director, *hostname, backendtype} setGauge(metric) + } else if metric.Type == "q" || metric.Type == "b" { + metric.Name = "varnishstat_backend_" + counter + metric.LabelNames = []string{"backend", "director", "host", "type"} + metric.LabelValues = []string{backend, director, *hostname, backendtype} + setGauge(metric) + } else { + log.Debug("Unknown metric type", "metrictype", metric.Type) } } else if strings.HasPrefix(key, "VBE.") { // Not the current VCL. Skip these.