Makes sense! I'm pretty sure the analytics query is going to be your best bet, then. For your particular use case, would it work to define a single generic analytics query that you can then trigger via another query's failure handler? You can trigger it with additionalScope in order to dynamically pass in a payload that is relevant to the current error being handled.
I do like the idea of a built-in utility function that would make this easier, but I'm not sure how feasible it would be, given that its usefulness would be scoped entirely to the self-hosted product. It's probably worth bringing up to the team, though!