mikrotik-exporter icon indicating copy to clipboard operation
mikrotik-exporter copied to clipboard

Slow metrics endpoint

Open rlex opened this issue 4 years ago • 2 comments

Monitoring two routers, both of them have around 100k routes via BGP.

When i call /metrics, it can take up to minute to print them. Does it calls mikrotik API every time i use /metrics?

rlex avatar May 05 '21 08:05 rlex

Yes, it does. What is your polling rate from prometheus? It doesn't do any sort of caching because it expects that your poll rate from Prometheus is what you want as the granularity of the metrics as reported by the exporter.

I have had the pondering of a couple of things to add in and I should probably just add them as issues to do here at some point. The first is to spin up a collection go func per device with a configurable max concurrency value. So that users with multiple devices won't have to wait for the serialization of all the devices.

The other would be the same thing, but for each metric type that needs to be collected. That I'm wondering on just how bad that would hammer the device API endpoint though. So at the very least I could do the first and see how it helps and then work on the second.

Does that sound like a possible "maybe it would help" thing @rlex?

nshttpd avatar May 06 '21 02:05 nshttpd

Oh, already add the go func per device thing already. I guess it's really just down to the other part then.

nshttpd avatar May 07 '21 01:05 nshttpd