@@ -366,25 +366,25 @@ func (c *Collector) buildW3SVCW3WP() error {
366366 )
367367 c .w3SVCW3WPWebSocketRequestsActive = prometheus .NewDesc (
368368 prometheus .BuildFQName (types .Namespace , Name , "worker_current_websocket_requests" ),
369- "" ,
369+ "Current number of active WebSocket requests in the worker process " ,
370370 []string {"app" , "pid" },
371371 nil ,
372372 )
373373 c .w3SVCW3WPWebSocketConnectionAttempts = prometheus .NewDesc (
374- prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_attempts_total " ),
375- "" ,
374+ prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_attempts_per_sec " ),
375+ "WebSocket connection attempts per second " ,
376376 []string {"app" , "pid" },
377377 nil ,
378378 )
379379 c .w3SVCW3WPWebSocketConnectionsAccepted = prometheus .NewDesc (
380- prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_accepted_total " ),
381- "" ,
380+ prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_accepted_per_sec " ),
381+ "WebSocket connections accepted per second " ,
382382 []string {"app" , "pid" },
383383 nil ,
384384 )
385385 c .w3SVCW3WPWebSocketConnectionsRejected = prometheus .NewDesc (
386- prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_rejected_total " ),
387- "" ,
386+ prometheus .BuildFQName (types .Namespace , Name , "worker_websocket_connection_rejected_per_sec " ),
387+ "WebSocket connections rejected per second " ,
388388 []string {"app" , "pid" },
389389 nil ,
390390 )
@@ -407,6 +407,10 @@ func (c *Collector) collectW3SVCW3WP(ch chan<- prometheus.Metric) error {
407407}
408408
409409func (c * Collector ) collectW3SVCW3WPv8 (ch chan <- prometheus.Metric ) error {
410+ if c .w3SVCW3WPPerfDataCollectorV8 == nil {
411+ return nil
412+ }
413+
410414 err := c .w3SVCW3WPPerfDataCollectorV8 .Collect (& c .perfDataObjectW3SVCW3WPV8 )
411415 if err != nil {
412416 return fmt .Errorf ("failed to collect APP_POOL_WAS metrics: %w" , err )
@@ -471,31 +475,31 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
471475
472476 ch <- prometheus .MustNewConstMetric (
473477 c .w3SVCW3WPWebSocketRequestsActive ,
474- prometheus .CounterValue ,
478+ prometheus .GaugeValue ,
475479 data .W3SVCW3WPWebSocketRequestsActive ,
476480 name ,
477481 pid ,
478482 )
479483
480484 ch <- prometheus .MustNewConstMetric (
481485 c .w3SVCW3WPWebSocketConnectionAttempts ,
482- prometheus .CounterValue ,
486+ prometheus .GaugeValue ,
483487 data .W3SVCW3WPWebSocketConnectionAttempts ,
484488 name ,
485489 pid ,
486490 )
487491
488492 ch <- prometheus .MustNewConstMetric (
489493 c .w3SVCW3WPWebSocketConnectionsAccepted ,
490- prometheus .CounterValue ,
494+ prometheus .GaugeValue ,
491495 data .W3SVCW3WPWebSocketConnectionsAccepted ,
492496 name ,
493497 pid ,
494498 )
495499
496500 ch <- prometheus .MustNewConstMetric (
497501 c .w3SVCW3WPWebSocketConnectionsRejected ,
498- prometheus .CounterValue ,
502+ prometheus .GaugeValue ,
499503 data .W3SVCW3WPWebSocketConnectionsRejected ,
500504 name ,
501505 pid ,
@@ -506,6 +510,10 @@ func (c *Collector) collectW3SVCW3WPv8(ch chan<- prometheus.Metric) error {
506510}
507511
508512func (c * Collector ) collectW3SVCW3WPv7 (ch chan <- prometheus.Metric ) error {
513+ if c .w3SVCW3WPPerfDataCollector == nil {
514+ return nil
515+ }
516+
509517 err := c .w3SVCW3WPPerfDataCollector .Collect (& c .perfDataObjectW3SVCW3WP )
510518 if err != nil {
511519 return fmt .Errorf ("failed to collect APP_POOL_WAS metrics: %w" , err )
@@ -539,7 +547,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
539547
540548 ch <- prometheus .MustNewConstMetric (
541549 c .w3SVCW3WPMaximumThreads ,
542- prometheus .CounterValue ,
550+ prometheus .GaugeValue ,
543551 data .W3SVCW3WPMaximumThreads ,
544552 name ,
545553 pid ,
@@ -555,7 +563,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
555563
556564 ch <- prometheus .MustNewConstMetric (
557565 c .w3SVCW3WPRequestsActive ,
558- prometheus .CounterValue ,
566+ prometheus .GaugeValue ,
559567 data .W3SVCW3WPRequestsActive ,
560568 name ,
561569 pid ,
@@ -579,7 +587,7 @@ func (c *Collector) collectW3SVCW3WPv7(ch chan<- prometheus.Metric) error {
579587
580588 ch <- prometheus .MustNewConstMetric (
581589 c .w3SVCW3WPMaximumFileCacheMemoryUsage ,
582- prometheus .CounterValue ,
590+ prometheus .GaugeValue ,
583591 data .W3SVCW3WPMaximumFileCacheMemoryUsage ,
584592 name ,
585593 pid ,
0 commit comments