Skip to content

Commit

Permalink
iis: Add IIS info metric (#1450)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored May 3, 2024
1 parent de8a1eb commit 7d8cf59
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions pkg/collector/iis/iis.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ type collector struct {
appInclude *string
appExclude *string

Info *prometheus.Desc

// Web Service
CurrentAnonymousUsers *prometheus.Desc
CurrentBlockedAsyncIORequests *prometheus.Desc
Expand Down Expand Up @@ -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"),
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7d8cf59

Please sign in to comment.