Closed stuart-warren closed 8 years ago
Nevermind, obviously thinking about it a request should probably give the 'current' values rather than stale cached ones.
Maybe a timeout per application would make more sense.
Went with an API client request timeout in the end...
We seem to have at least one application that has over 1000 pages of metric names :( https://api.newrelic.com/v2/applications/%appid%/metrics.json?page=1240
To make this worse, it takes about 6 seconds to fetch each page of metric names... about 2 hours just to get the names, let alone the metrics :'(
Took quite a while to work out where this was getting 'stuck', but everything blocks until these requests finish.
Obviously ideally we wouldn't have so many, but is it possible/sensible to asynchronously update the Exporter.metrics map? Maybe a pool of goroutines fetching an application each.