From 4cfc34ce0bc2a9c7e36cadeea4af8946d22c1c74 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Tue, 14 Jan 2025 10:02:54 -0800 Subject: [PATCH] add prom-only test counter and statsd-only label Just making sure we're right about how the direct prometheus monitoring isn't running. Updates AUT-393 --- main.go | 3 ++- stats.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index be1e392f2..1a3f3c7c2 100644 --- a/main.go +++ b/main.go @@ -252,8 +252,9 @@ func run(conf configuration, listen string, debug bool) { router.PathPrefix(prefix).Handler(http.StripPrefix(prefix, http.FileServer(http.Dir(parsedURL.Path)))) } - ag.stats.Incr(foobarTestCounterName, nil, 1) + ag.stats.Incr(foobarTestCounterName, []string{"statsd:yes"}, 1) foobarTestCounter.Inc() + promOnlyFoobarTestCounterName.Inc() if conf.DebugServer.Listen != "" { log.Infof("starting debug server on %s", conf.DebugServer.Listen) diff --git a/stats.go b/stats.go index 48b46034f..9218bc12b 100644 --- a/stats.go +++ b/stats.go @@ -19,6 +19,10 @@ var ( Name: foobarTestCounterName, Help: "A counter used for testing how prometheus and statsd metrics differ", }) + promOnlyFoobarTestCounterName = promauto.NewCounter(prometheus.CounterOpts{ + Name: "prom_only_foobar_test", + Help: "A counter used for testing how prometheus and statsd metrics differ", + }) ) func loadStatsd(conf configuration) (*statsd.Client, error) {