mirror of
https://github.com/prometheus-community/windows_exporter
synced 2025-02-04 13:53:40 +00:00
iis: Add IIS info metric (#1450)
This commit is contained in:
parent
de8a1ebbfe
commit
7d8cf59dac
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user