pub fn log_message_latency_if_sampling(headers: &Attrs, actor_id: String)
Expand description
This function checks the configured sampling rate and, if the random sample passes, calculates the latency between the send timestamp and the current time, then records the latency metric with the associated actor ID.