Can Performance Counters be disabled to prevent event log warnings - "NServiceBus performance counter for '# of msgs pulled from the input queue /sec' is not set up correctly."

I have a self hosting deployment of NServiceBus 6.2 and during startup I am receiving 3 warnings in the event log similar to below:
“NServiceBus performance counter for ‘# of msgs pulled from the input queue /sec’ is not set up correctly. To rectify this problem, consult the NServiceBus performance counters documentation.”

Is there a way to turn off performance counters? Or to surpess the warning message?

I have taken a look through the performance counters documentation, but can only see how to install and setup the performance counters.

We do not require the performance counters at this time.

Thanks in advance.

Hi Stu!

The counters are enabled by default as you noticed. To disable them use the following code:

endpointConfiguration.DisableFeature<NServiceBus.Features.ReceiveStatisticsPerformanceCounters>();

ReceiveStatisticsPerformanceCounters is flagged as obsolete with a WARN so you might have to suppress that warning for your project to compile. The reason for the obsolete is that we’ve moved the performance counters to a dedicated package as of v7 and also made them opt-in.

Hope this helps!

Cheers,

Andreas

1 Like

Fantastic, Thank you for the quick response Andreas.

Cheers,
Stu.