I’m trying to get some visibility into my resource pools (redis, mysql and worker threads).
Each pool has several metrics, for example
current size and
number of available connections, for the redis connection pool.
I basically want to know if my pools are correctly sized for the current load and if we’re approaching a limit.
On top of that, my application is server by puma, using its cluster mode, which means on each host I have multiple instances of the pools.
I tried following the examples in this post by having a background thread poll the pools for their metrics every second and sending them as event attributes to NR using
I added an attribute identifying each puma worker (
worker_id) to each event, otherwise we would have a “last one wins” effect.
I’m now trying to aggregate (sum) those data across hosts and puma workers, to get a single graph with each metric for a pool, because I don’t need the details per host or worker, and I don’t want to have multiple graphs for each pool type.
I understand from this question that I cannot do something like
SELECT latest(sum(size)) ... FACET host, worker_id, so I’m wondering if there is something else I can do.
Maybe events are not the correct tool?