Skip to content

Commit 62b796e

Browse files
authored
exchange: fix The specified counter could not be found (#1994) (#2038)
1 parent 8bae1ab commit 62b796e

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

docs/collector.exchange.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Comma-separated list of collectors to use, for example: `--collectors.exchange.e
4343
| `windows_exchange_transport_queues_messages_submitted_total` | Messages Submitted Total |
4444
| `windows_exchange_transport_queues_messages_delayed_total` | Messages Delayed Total |
4545
| `windows_exchange_transport_queues_messages_completed_delivery_total` | Messages Completed Delivery Total |
46-
| `windows_exchange_transport_queues_shadow_queue_length` | Shadow Queue Length |
46+
| `windows_exchange_transport_queues_aggregate_shadow_queue_length` | The current number of messages in shadow queues |
4747
| `windows_exchange_transport_queues_submission_queue_length` | Submission Queue Length |
4848
| `windows_exchange_transport_queues_delay_queue_length` | Delay Queue Length |
4949
| `windows_exchange_transport_queues_items_completed_delivery_total` | Items Completed Delivery Total |
@@ -54,7 +54,7 @@ Comma-separated list of collectors to use, for example: `--collectors.exchange.e
5454
| `windows_exchange_http_proxy_avg_auth_latency` | Average time spent authenticating CAS requests over the last 200 samples |
5555
| `windows_exchange_http_proxy_outstanding_proxy_requests` | Number of concurrent outstanding proxy requests |
5656
| `windows_exchange_http_proxy_requests_total` | Number of proxy requests processed each second |
57-
| `windows_exchange_avail_service_requests_per_sec` | Number of requests serviced per second |
57+
| `windows_exchange_availability_service_requests_per_sec` | Number of requests serviced per second |
5858
| `windows_exchange_owa_current_unique_users` | Number of unique users currently logged on to Outlook Web App |
5959
| `windows_exchange_owa_requests_total` | Number of requests handled by Outlook Web App per second |
6060
| `windows_exchange_autodiscover_requests_total` | Number of autodiscover service requests processed each second |
@@ -77,4 +77,3 @@ _This collector does not yet have any useful queries added, we would appreciate
7777

7878
## Alerting examples
7979
_This collector does not yet have alerting examples, we would appreciate your help adding them!_
80-

internal/collector/exchange/exchange_autodiscover.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type perfDataCounterValuesAutoDiscover struct {
3737
func (c *Collector) buildAutoDiscover() error {
3838
var err error
3939

40-
c.perfDataCollectorAutoDiscover, err = pdh.NewCollector[perfDataCounterValuesAutoDiscover](pdh.CounterTypeRaw, "MSExchange Autodiscover", pdh.InstancesAll)
40+
c.perfDataCollectorAutoDiscover, err = pdh.NewCollector[perfDataCounterValuesAutoDiscover](pdh.CounterTypeRaw, "MSExchangeAutodiscover", nil)
4141
if err != nil {
4242
return fmt.Errorf("failed to create MSExchange Autodiscover collector: %w", err)
4343
}

internal/collector/exchange/exchange_availability_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type collectorAvailabilityService struct {
3131
}
3232

3333
type perfDataCounterValuesAvailabilityService struct {
34-
RequestsPerSec float64 `perfdata:"Requests/sec"`
34+
AvailabilityRequestsPerSec float64 `perfdata:"Availability Requests (sec)"`
3535
}
3636

3737
func (c *Collector) buildAvailabilityService() error {
@@ -43,7 +43,7 @@ func (c *Collector) buildAvailabilityService() error {
4343
}
4444

4545
c.availabilityRequestsSec = prometheus.NewDesc(
46-
prometheus.BuildFQName(types.Namespace, Name, "avail_service_requests_per_sec"),
46+
prometheus.BuildFQName(types.Namespace, Name, "availability_service_requests_per_sec"),
4747
"Number of requests serviced per second",
4848
nil,
4949
nil,
@@ -62,7 +62,7 @@ func (c *Collector) collectAvailabilityService(ch chan<- prometheus.Metric) erro
6262
ch <- prometheus.MustNewConstMetric(
6363
c.availabilityRequestsSec,
6464
prometheus.CounterValue,
65-
data.RequestsPerSec,
65+
data.AvailabilityRequestsPerSec,
6666
)
6767
}
6868

internal/collector/exchange/exchange_transport_queues.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type collectorTransportQueues struct {
3939
messagesSubmittedTotal *prometheus.Desc
4040
messagesDelayedTotal *prometheus.Desc
4141
messagesCompletedDeliveryTotal *prometheus.Desc
42-
shadowQueueLength *prometheus.Desc
42+
aggregateShadowQueueLength *prometheus.Desc
4343
submissionQueueLength *prometheus.Desc
4444
delayQueueLength *prometheus.Desc
4545
itemsCompletedDeliveryTotal *prometheus.Desc
@@ -63,7 +63,7 @@ type perfDataCounterValuesTransportQueues struct {
6363
MessagesSubmittedTotal float64 `perfdata:"Messages Submitted Total"`
6464
MessagesDelayedTotal float64 `perfdata:"Messages Delayed Total"`
6565
MessagesCompletedDeliveryTotal float64 `perfdata:"Messages Completed Delivery Total"`
66-
ShadowQueueLength float64 `perfdata:"Shadow Queue Length"`
66+
AggregateShadowQueueLength float64 `perfdata:"Aggregate Shadow Queue Length"`
6767
SubmissionQueueLength float64 `perfdata:"Submission Queue Length"`
6868
DelayQueueLength float64 `perfdata:"Delay Queue Length"`
6969
ItemsCompletedDeliveryTotal float64 `perfdata:"Items Completed Delivery Total"`
@@ -152,9 +152,9 @@ func (c *Collector) buildTransportQueues() error {
152152
[]string{"name"},
153153
nil,
154154
)
155-
c.shadowQueueLength = prometheus.NewDesc(
156-
prometheus.BuildFQName(types.Namespace, Name, "transport_queues_shadow_queue_length"),
157-
"Shadow Queue Length",
155+
c.aggregateShadowQueueLength = prometheus.NewDesc(
156+
prometheus.BuildFQName(types.Namespace, Name, "transport_queues_aggregate_shadow_queue_length"),
157+
"The current number of messages in shadow queues.",
158158
[]string{"name"},
159159
nil,
160160
)
@@ -280,9 +280,9 @@ func (c *Collector) collectTransportQueues(ch chan<- prometheus.Metric) error {
280280
labelName,
281281
)
282282
ch <- prometheus.MustNewConstMetric(
283-
c.shadowQueueLength,
283+
c.aggregateShadowQueueLength,
284284
prometheus.GaugeValue,
285-
data.ShadowQueueLength,
285+
data.AggregateShadowQueueLength,
286286
labelName,
287287
)
288288
ch <- prometheus.MustNewConstMetric(

0 commit comments

Comments
 (0)