Open
Description
As useful as the existing Ruby VMs functionality is, we are faced with some challenges when reporting on Ruby VM based metrics / statistics:
- Stats are global for an entire host, as has discussed recently with Object Allocation Capture at the transaction level #2311
- Adding new stats requires updating the Ruby VMs dashboard section, as discussed recently with Enhance the "Ruby VMs" UI section #2351
- There are quite a lot of stats that we are not collecting. We grab info on about a dozen things. Without YJIT, about 30 additional things could be reported on. With YJIT, there are at least an additional 18 things available for collecting, with hundreds more available when YJIT is operating in stats collecting mode (which incurs a performance hit) and the optional tracing exits mode. See Innovation: Glean metrics from YJIT #2215, Evaluate whether any additional garbage collection stats would be useful #2322, and Evaluate additional Ruby VM stats for inclusion #2350.
Proposal: provide users with the ability to opt-in to transaction based VM stats ("VM" here being a broad term that should include GC and YJIT stats).
An initial set of readings would be taken at the start of a transaction, and then an updated set of readings would be taken at the end of the transaction. We could either send up deltas or both before and after numbers as agent attributes on a transaction.
Let's explore what is possible here. Perhaps allowlist/blocklist functionality could be offered at the config level to permit for fine grained selection of stats.