Thanks for your ideas, @gavanderhoorn . I think Bond is quite an overkill for the task at hand.
And yes, I know that the frequency of the heartbeat messages does not say much - there can still be sensor blockage, wrong processing of data etc… However, as the heartbeat should be published right before/after publishing the sensor message, you can at least figure out whether the sensor readout callback is called at the expected rate. For example with Ouster, UDP data can stop coming from the sensor either because of a network failure or because the sensor is overheated… And then the callbacks stop being called. Heartbeat is just the very basic diagnostic helping with a part of monitoring. If you have a critical sensor, you should of course not be satisfied with heartbeats. But in a lot of cases, they could be enough.