Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion internal/collector/iis/iis_app_pool_was.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ func (c *Collector) buildAppPoolWAS() error {
}

func (c *Collector) collectAppPoolWAS(ch chan<- prometheus.Metric) error {
if c.perfDataCollectorAppPoolWAS == nil {
return nil
}

err := c.perfDataCollectorAppPoolWAS.Collect(&c.perfDataObjectAppPoolWAS)
if err != nil {
return fmt.Errorf("failed to collect APP_POOL_WAS metrics: %w", err)
Expand Down Expand Up @@ -239,7 +243,7 @@ func (c *Collector) collectAppPoolWAS(ch chan<- prometheus.Metric) error {

ch <- prometheus.MustNewConstMetric(
c.totalApplicationPoolUptime,
prometheus.CounterValue,
prometheus.GaugeValue,
data.TotalApplicationPoolUptime,
data.Name,
)
Expand Down
6 changes: 5 additions & 1 deletion internal/collector/iis/iis_http_service_request_queues.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func (c *Collector) buildHttpServiceRequestQueues() error {
}

func (c *Collector) collectHttpServiceRequestQueues(ch chan<- prometheus.Metric) error {
if c.perfDataCollectorHttpServiceRequestQueues == nil {
return nil
}

err := c.perfDataCollectorHttpServiceRequestQueues.Collect(&c.perfDataObjectHttpServiceRequestQueues)
if err != nil {
return fmt.Errorf("failed to collect Http Service Request Queues metrics: %w", err)
Expand All @@ -113,7 +117,7 @@ func (c *Collector) collectHttpServiceRequestQueues(ch chan<- prometheus.Metric)

ch <- prometheus.MustNewConstMetric(
c.httpRequestQueuesTotalRejectedRequest,
prometheus.GaugeValue,
prometheus.CounterValue,
data.HttpRequestQueuesTotalRejectedRequests,
data.Name,
)
Expand Down
36 changes: 22 additions & 14 deletions internal/collector/iis/iis_w3svc_w3wp.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,25 +366,25 @@ func (c *Collector) buildW3SVCW3WP() error {
)
c.w3SVCW3WPWebSocketRequestsActive = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_current_websocket_requests"),
"",
"Current number of active WebSocket requests in the worker process",
[]string{"app", "pid"},
nil,
)
c.w3SVCW3WPWebSocketConnectionAttempts = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_attempts_total"),
"",
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_attempts_per_sec"),
"WebSocket connection attempts per second",
[]string{"app", "pid"},
nil,
)
c.w3SVCW3WPWebSocketConnectionsAccepted = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_accepted_total"),
"",
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_accepted_per_sec"),
"WebSocket connections accepted per second",
[]string{"app", "pid"},
nil,
)
c.w3SVCW3WPWebSocketConnectionsRejected = prometheus.NewDesc(
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_rejected_total"),
"",
prometheus.BuildFQName(types.Namespace, Name, "worker_websocket_connection_rejected_per_sec"),
"WebSocket connections rejected per second",
[]string{"app", "pid"},
nil,
)
Expand All @@ -407,6 +407,10 @@ func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
}

func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
if c.w3SVCW3WPPerfDataCollectorV8 == nil {
return nil
}

err := c.w3SVCW3WPPerfDataCollectorV8.Collect(&c.perfDataObjectW3SVCW3WPV8)
if err != nil {
return fmt.Errorf("failed to collect APP_POOL_WAS metrics: %w", err)
Expand Down Expand Up @@ -471,31 +475,31 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketRequestsActive,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPWebSocketRequestsActive,
name,
pid,
)

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionAttempts,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPWebSocketConnectionAttempts,
name,
pid,
)

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionsAccepted,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPWebSocketConnectionsAccepted,
name,
pid,
)

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPWebSocketConnectionsRejected,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPWebSocketConnectionsRejected,
name,
pid,
Expand All @@ -506,6 +510,10 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
}

func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
if c.w3SVCW3WPPerfDataCollector == nil {
return nil
}

err := c.w3SVCW3WPPerfDataCollector.Collect(&c.perfDataObjectW3SVCW3WP)
if err != nil {
return fmt.Errorf("failed to collect APP_POOL_WAS metrics: %w", err)
Expand Down Expand Up @@ -539,7 +547,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMaximumThreads,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPMaximumThreads,
name,
pid,
Expand All @@ -555,7 +563,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPRequestsActive,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPRequestsActive,
name,
pid,
Expand All @@ -579,7 +587,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {

ch <- prometheus.MustNewConstMetric(
c.w3SVCW3WPMaximumFileCacheMemoryUsage,
prometheus.CounterValue,
prometheus.GaugeValue,
data.W3SVCW3WPMaximumFileCacheMemoryUsage,
name,
pid,
Expand Down
4 changes: 4 additions & 0 deletions internal/collector/iis/iis_web_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ func (c *Collector) buildWebService() error {
}

func (c *Collector) collectWebService(ch chan<- prometheus.Metric) error {
if c.perfDataCollectorWebService == nil {
return nil
}

err := c.perfDataCollectorWebService.Collect(&c.perfDataObjectWebService)
if err != nil {
return fmt.Errorf("failed to collect Web Service metrics: %w", err)
Expand Down
4 changes: 4 additions & 0 deletions internal/collector/iis/iis_web_service_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ func (c *Collector) buildWebServiceCache() error {
}

func (c *Collector) collectWebServiceCache(ch chan<- prometheus.Metric) error {
if c.serviceCachePerfDataCollector == nil {
return nil
}

err := c.serviceCachePerfDataCollector.Collect(&c.perfDataObjectServiceCache)
if err != nil {
return fmt.Errorf("failed to collect Web Service Cache metrics: %w", err)
Expand Down
Loading