Add metrics to track beacon processor queue times (#7808)

This PR adds a created_timestamp to the beacon processor send channel. When work items are sent through that channel `try_send` will forward the work event along with the current timestamp to the beacon processor. When the work event is completed the `Drop` impl for `SendOnDrop` will track the time it took from work event creation to its completion. Previously we only had data on how long a work event took to process, but didn't have data on how long it sat in the queue + how long it took to process.
This commit is contained in:
Eitan Seri-Levi
2025-08-11 18:06:42 -07:00
committed by GitHub
parent 4262ad3e01
commit 122f16776f
2 changed files with 54 additions and 21 deletions

View File

@@ -128,3 +128,10 @@ pub static BEACON_PROCESSOR_SEND_ERROR_PER_WORK_TYPE: LazyLock<Result<IntCounter
&["type"],
)
});
pub static BEACON_PROCESSOR_QUEUE_TIME: LazyLock<Result<HistogramVec>> = LazyLock::new(|| {
try_create_histogram_vec(
"beacon_processor_queue_time",
"The delay between when a work event was queued in the beacon processor and when it was popped from the queue",
&["work_type"]
)
});