mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-05 01:56:35 +00:00
Added WebService uptime metric in iis collector
Signed-off-by: kaffarell <gabrielgoller123@gmail.com>
This commit is contained in:
@@ -69,6 +69,7 @@ type IISCollector struct {
|
||||
CurrentConnections *prometheus.Desc
|
||||
CurrentISAPIExtensionRequests *prometheus.Desc
|
||||
CurrentNonAnonymousUsers *prometheus.Desc
|
||||
ServiceUptime *prometheus.Desc
|
||||
TotalBytesReceived *prometheus.Desc
|
||||
TotalBytesSent *prometheus.Desc
|
||||
TotalAnonymousUsers *prometheus.Desc
|
||||
@@ -242,6 +243,12 @@ func NewIISCollector() (Collector, error) {
|
||||
[]string{"site"},
|
||||
nil,
|
||||
),
|
||||
ServiceUptime: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "service_uptime"),
|
||||
"Number of seconds the WebService is up (WebService.ServiceUptime)",
|
||||
[]string{"site"},
|
||||
nil,
|
||||
),
|
||||
TotalBytesReceived: prometheus.NewDesc(
|
||||
prometheus.BuildFQName(Namespace, subsystem, "received_bytes_total"),
|
||||
"Number of data bytes that have been received by the Web service (WebService.TotalBytesReceived)",
|
||||
@@ -845,6 +852,7 @@ type perflibWebService struct {
|
||||
CurrentConnections float64 `perflib:"Current Connections"`
|
||||
CurrentISAPIExtensionRequests float64 `perflib:"Current ISAPI Extension Requests"`
|
||||
CurrentNonAnonymousUsers float64 `perflib:"Current NonAnonymous Users"`
|
||||
ServiceUptime float64 `perflib:"Service Uptime"`
|
||||
|
||||
TotalBytesReceived float64 `perflib:"Total Bytes Received"`
|
||||
TotalBytesSent float64 `perflib:"Total Bytes Sent"`
|
||||
@@ -925,6 +933,12 @@ func (c *IISCollector) collectWebService(ctx *ScrapeContext, ch chan<- prometheu
|
||||
app.CurrentNonAnonymousUsers,
|
||||
app.Name,
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.ServiceUptime,
|
||||
prometheus.GaugeValue,
|
||||
app.ServiceUptime,
|
||||
app.Name,
|
||||
)
|
||||
ch <- prometheus.MustNewConstMetric(
|
||||
c.TotalBytesReceived,
|
||||
prometheus.CounterValue,
|
||||
|
||||
Reference in New Issue
Block a user