Skip to content

Commit

Permalink
Merge pull request #887 from SouenMazouin/fix/request-error-total-iis
Browse files Browse the repository at this point in the history
fix: add missing metrics for IIS version >= 8
  • Loading branch information
carlpett authored Dec 18, 2021
2 parents 376060b + 6120ea9 commit 524bfde
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions collector/iis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ package collector

import (
"fmt"
"regexp"

"github.com/prometheus-community/windows_exporter/log"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/sys/windows/registry"
"gopkg.in/alecthomas/kingpin.v2"
"regexp"
)

func init() {
Expand Down Expand Up @@ -411,7 +412,7 @@ func NewIISCollector() (Collector, error) {
nil,
),

// W3WP_W3SVC
// W3SVC_W3WP
Threads: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_threads"),
"",
Expand Down Expand Up @@ -604,6 +605,37 @@ func NewIISCollector() (Collector, error) {
[]string{"app", "pid"},
nil,
),
// W3SVC_W3WP_IIS8
RequestErrorsTotal: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_request_errors_total"),
"",
[]string{"app", "pid", "status_code"},
nil,
),
WebSocketRequestsActive: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_current_websocket_requests"),
"",
[]string{"app", "pid"},
nil,
),
WebSocketConnectionAttempts: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_websocket_connection_attempts_total"),
"",
[]string{"app", "pid"},
nil,
),
WebSocketConnectionsAccepted: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_websocket_connection_accepted_total"),
"",
[]string{"app", "pid"},
nil,
),
WebSocketConnectionsRejected: prometheus.NewDesc(
prometheus.BuildFQName(Namespace, subsystem, "worker_websocket_connection_rejected_total"),
"",
[]string{"app", "pid"},
nil,
),

// Web Service Cache
ServiceCache_ActiveFlushedEntries: prometheus.NewDesc(
Expand Down Expand Up @@ -1543,7 +1575,7 @@ func (c *IISCollector) collectW3SVC_W3WP(ctx *ScrapeContext, ch chan<- prometheu

if c.iis_version.major >= 8 {
var W3SVC_W3WP_IIS8 []perflibW3SVC_W3WP_IIS8
if err := unmarshalObject(ctx.perfObjects["W3SVC_W3WP"], &W3SVC_W3WP); err != nil {
if err := unmarshalObject(ctx.perfObjects["W3SVC_W3WP"], &W3SVC_W3WP_IIS8); err != nil {
return nil, err
}

Expand Down

0 comments on commit 524bfde

Please sign in to comment.