HA endpoint latency monitoring/telemetry/observability

I’m wondering if there are any hooks for setting up endpoint latency/rps monitoring on HA endpoints (like you’d traditionally set up on a production web service).

I’m trying to debug why sometimes HomeKit is really slow to respond, and it’d be nice to see the max and 99 percentile latencies to the related endpoints on HA. It seems to get worse the more times I update HA without rebooting, and immediately better after I reboot my Pi4 – I don’t know why this would be so I want to see if I can gather some data to prove or disprove what I’m experiencing anecdotally.

In general I think this would be a handy capability.