Metrics with Prometheus missing counters

Hello.

We’ve been using prometheus for a while on our endpoints (to let the infra scrape some basic stats) and now I’m trying to add NServiceBus specific metrics.

I’m looking at https://docs.particular.net/samples/logging/prometheus-grafana/ and we do get metrics, but we’re missing two:

nservicebus_criticaltime_seconds
nservicebus_processingtime_seconds

We do however have

nservicebus_criticaltime_seconds_sum
nservicebus_criticaltime_seconds_count
nservicebus_processingtime_seconds_sum
nservicebus_processingtime_seconds_count

but not the ones without the suffix.

If I run the sample Metrics 3 I do however get all the counters. I’ve found out that the difference from our services are that we’re using a newer version of prometheus-net (as we’re running on .net core).

If I update the prometheus-net in the sample from 1.3.5 to 3.1.4 (latest atm) that sample also misses the two metrics I mentioned.

Any ideas?

//J

Hi Jens

I have a hunch it is related to a breaking change or a regression in the client. I’ve downloaded the sample and let it run with 2.x version of prometheus net client and it works fine. Once I upgrade to the 3.0 version of the client it no longer works.

Regards
Daniel

Any ideas if it’s possible to make it work with the 3.0 client? Anything I can do on my side or is it something within NServiceBus.Metrics or the prometheus lib itself? We have other prometheus metrics which at the moment has a dependency on the 3.x client and I would rather not have to downgrade those things…

If it isn’t anything you guys can do, I will check elsewhere! :slight_smile:

Jens according to my brief research it looks like something in the prometheus lib itself because the sample code did not change between those two versions nor did the metrics library in ways that would explain the behavior.

Maybe I can shuffle some time free to have a deeper look into it but I can’t promise because I’m traveling soon and will be unavailable for a few days.

No worries, Daniel! Have a nice trip!