From 7d8cf59dac1c3df6ca8bcfce05f6000af2b1af01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Fri, 3 May 2024 07:51:29 +0200 Subject: [PATCH] iis: Add IIS info metric (#1450) --- pkg/collector/iis/iis.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pkg/collector/iis/iis.go b/pkg/collector/iis/iis.go index 8703bd5e..86cfd489 100644 --- a/pkg/collector/iis/iis.go +++ b/pkg/collector/iis/iis.go @@ -85,6 +85,8 @@ type collector struct { appInclude *string appExclude *string + Info *prometheus.Desc + // Web Service CurrentAnonymousUsers *prometheus.Desc CurrentBlockedAsyncIORequests *prometheus.Desc @@ -300,6 +302,15 @@ func (c *collector) Build() error { return err } + c.Info = prometheus.NewDesc( + prometheus.BuildFQName(types.Namespace, Name, "info"), + "ISS information", + []string{}, + prometheus.Labels{ + "version": fmt.Sprintf("%d.%d", c.iis_version.major, c.iis_version.minor), + }, + ) + // Web Service c.CurrentAnonymousUsers = prometheus.NewDesc( prometheus.BuildFQName(types.Namespace, Name, "current_anonymous_users"), @@ -1034,6 +1045,12 @@ func (c *collector) collectWebService(ctx *types.ScrapeContext, ch chan<- promet return nil, err } + ch <- prometheus.MustNewConstMetric( + c.Info, + prometheus.GaugeValue, + 1, + ) + webServiceDeDuplicated := dedupIISNames(webService) for name, app := range webServiceDeDuplicated {