Skip to content

Commit 85455bd

Browse files
authored
exchange: fix The specified counter could not be found (#1994)
1 parent f1f763b commit 85455bd

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
@@ -39,7 +39,7 @@ type perfDataCounterValuesAutoDiscover struct {
3939
func (c *Collector) buildAutoDiscover() error {
4040
var err error
4141

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

internal/collector/exchange/exchange_availability_service.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type collectorAvailabilityService struct {
3333
}
3434

3535
type perfDataCounterValuesAvailabilityService struct {
36-
RequestsPerSec float64 `perfdata:"Requests/sec"`
36+
AvailabilityRequestsPerSec float64 `perfdata:"Availability Requests (sec)"`
3737
}
3838

3939
func (c *Collector) buildAvailabilityService() error {
@@ -45,7 +45,7 @@ func (c *Collector) buildAvailabilityService() error {
4545
}
4646

4747
c.availabilityRequestsSec = prometheus.NewDesc(
48-
prometheus.BuildFQName(types.Namespace, Name, "avail_service_requests_per_sec"),
48+
prometheus.BuildFQName(types.Namespace, Name, "availability_service_requests_per_sec"),
4949
"Number of requests serviced per second",
5050
nil,
5151
nil,
@@ -64,7 +64,7 @@ func (c *Collector) collectAvailabilityService(ch chan<- prometheus.Metric) erro
6464
ch <- prometheus.MustNewConstMetric(
6565
c.availabilityRequestsSec,
6666
prometheus.CounterValue,
67-
data.RequestsPerSec,
67+
data.AvailabilityRequestsPerSec,
6868
)
6969
}
7070

internal/collector/exchange/exchange_transport_queues.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ type collectorTransportQueues struct {
4141
messagesSubmittedTotal *prometheus.Desc
4242
messagesDelayedTotal *prometheus.Desc
4343
messagesCompletedDeliveryTotal *prometheus.Desc
44-
shadowQueueLength *prometheus.Desc
44+
aggregateShadowQueueLength *prometheus.Desc
4545
submissionQueueLength *prometheus.Desc
4646
delayQueueLength *prometheus.Desc
4747
itemsCompletedDeliveryTotal *prometheus.Desc
@@ -65,7 +65,7 @@ type perfDataCounterValuesTransportQueues struct {
6565
MessagesSubmittedTotal float64 `perfdata:"Messages Submitted Total"`
6666
MessagesDelayedTotal float64 `perfdata:"Messages Delayed Total"`
6767
MessagesCompletedDeliveryTotal float64 `perfdata:"Messages Completed Delivery Total"`
68-
ShadowQueueLength float64 `perfdata:"Shadow Queue Length"`
68+
AggregateShadowQueueLength float64 `perfdata:"Aggregate Shadow Queue Length"`
6969
SubmissionQueueLength float64 `perfdata:"Submission Queue Length"`
7070
DelayQueueLength float64 `perfdata:"Delay Queue Length"`
7171
ItemsCompletedDeliveryTotal float64 `perfdata:"Items Completed Delivery Total"`
@@ -154,9 +154,9 @@ func (c *Collector) buildTransportQueues() error {
154154
[]string{"name"},
155155
nil,
156156
)
157-
c.shadowQueueLength = prometheus.NewDesc(
158-
prometheus.BuildFQName(types.Namespace, Name, "transport_queues_shadow_queue_length"),
159-
"Shadow Queue Length",
157+
c.aggregateShadowQueueLength = prometheus.NewDesc(
158+
prometheus.BuildFQName(types.Namespace, Name, "transport_queues_aggregate_shadow_queue_length"),
159+
"The current number of messages in shadow queues.",
160160
[]string{"name"},
161161
nil,
162162
)
@@ -282,9 +282,9 @@ func (c *Collector) collectTransportQueues(ch chan<- prometheus.Metric) error {
282282
labelName,
283283
)
284284
ch <- prometheus.MustNewConstMetric(
285-
c.shadowQueueLength,
285+
c.aggregateShadowQueueLength,
286286
prometheus.GaugeValue,
287-
data.ShadowQueueLength,
287+
data.AggregateShadowQueueLength,
288288
labelName,
289289
)
290290
ch <- prometheus.MustNewConstMetric(

0 commit comments

Comments
 (0)