mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-02-21 12:16:36 +00:00
iis: Add IIS info metric (#1450)
This commit is contained in:
@@ -85,6 +85,8 @@ type collector struct {
|
|||||||
appInclude *string
|
appInclude *string
|
||||||
appExclude *string
|
appExclude *string
|
||||||
|
|
||||||
|
Info *prometheus.Desc
|
||||||
|
|
||||||
// Web Service
|
// Web Service
|
||||||
CurrentAnonymousUsers *prometheus.Desc
|
CurrentAnonymousUsers *prometheus.Desc
|
||||||
CurrentBlockedAsyncIORequests *prometheus.Desc
|
CurrentBlockedAsyncIORequests *prometheus.Desc
|
||||||
@@ -300,6 +302,15 @@ func (c *collector) Build() error {
|
|||||||
return err
|
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
|
// Web Service
|
||||||
c.CurrentAnonymousUsers = prometheus.NewDesc(
|
c.CurrentAnonymousUsers = prometheus.NewDesc(
|
||||||
prometheus.BuildFQName(types.Namespace, Name, "current_anonymous_users"),
|
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
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ch <- prometheus.MustNewConstMetric(
|
||||||
|
c.Info,
|
||||||
|
prometheus.GaugeValue,
|
||||||
|
1,
|
||||||
|
)
|
||||||
|
|
||||||
webServiceDeDuplicated := dedupIISNames(webService)
|
webServiceDeDuplicated := dedupIISNames(webService)
|
||||||
|
|
||||||
for name, app := range webServiceDeDuplicated {
|
for name, app := range webServiceDeDuplicated {
|
||||||
|
|||||||
Reference in New Issue
Block a user