pub(crate) const COORDINATOR_SEND_DURATION_SECONDS: &str =
"opendata_write_coordinator_send_duration_seconds";
pub(crate) const COORDINATOR_QUEUE_BACKPRESSURE_TOTAL: &str =
"opendata_write_coordinator_queue_backpressure_total";
pub(crate) const COORDINATOR_QUEUE_DEPTH: &str = "opendata_write_coordinator_queue_depth";
pub(crate) const COORDINATOR_DELTA_APPLY_DURATION_SECONDS: &str =
"opendata_write_coordinator_delta_apply_duration_seconds";
pub(crate) const COORDINATOR_DELTA_ESTIMATED_BYTES: &str =
"opendata_write_coordinator_delta_estimated_bytes";
pub(crate) const COORDINATOR_DELTA_FREEZE_DURATION_SECONDS: &str =
"opendata_write_coordinator_delta_freeze_duration_seconds";
pub(crate) const COORDINATOR_FLUSH_EVENT_SEND_DURATION_SECONDS: &str =
"opendata_write_coordinator_flush_event_send_duration_seconds";
pub(crate) const COORDINATOR_FLUSH_EVENT_QUEUE_DEPTH: &str =
"opendata_write_coordinator_flush_event_queue_depth";
pub(crate) const COORDINATOR_FLUSH_TOTAL: &str = "opendata_write_coordinator_flush_total";
pub(crate) const COORDINATOR_FLUSH_DELTA_DURATION_SECONDS: &str =
"opendata_write_coordinator_flush_delta_duration_seconds";
pub(crate) const COORDINATOR_FLUSH_STORAGE_DURATION_SECONDS: &str =
"opendata_write_coordinator_flush_storage_duration_seconds";
pub fn describe_coordinator_metrics() {
metrics::describe_histogram!(
COORDINATOR_SEND_DURATION_SECONDS,
"Latency of submitting a command to the write coordinator queue (seconds)"
);
metrics::describe_counter!(
COORDINATOR_QUEUE_BACKPRESSURE_TOTAL,
"Coordinator queue rejections due to a full or closed queue"
);
metrics::describe_gauge!(
COORDINATOR_QUEUE_DEPTH,
"Approximate write coordinator queue depth, sampled on each send"
);
metrics::describe_histogram!(
COORDINATOR_DELTA_APPLY_DURATION_SECONDS,
"Time spent in Delta::apply on the coordinator hot path (seconds)"
);
metrics::describe_gauge!(
COORDINATOR_DELTA_ESTIMATED_BYTES,
"Estimated bytes in the current (mutable) delta"
);
metrics::describe_histogram!(
COORDINATOR_DELTA_FREEZE_DURATION_SECONDS,
"Time spent freezing the current delta on the coordinator hot path (seconds)"
);
metrics::describe_histogram!(
COORDINATOR_FLUSH_EVENT_SEND_DURATION_SECONDS,
"Time spent dispatching a flush event from the coordinator to the flush task (seconds)"
);
metrics::describe_gauge!(
COORDINATOR_FLUSH_EVENT_QUEUE_DEPTH,
"Approximate depth of the coordinator's flush-event channel"
);
metrics::describe_counter!(
COORDINATOR_FLUSH_TOTAL,
"Coordinator flush triggers labeled by reason"
);
metrics::describe_histogram!(
COORDINATOR_FLUSH_DELTA_DURATION_SECONDS,
"Background Flusher::flush_delta duration (seconds)"
);
metrics::describe_histogram!(
COORDINATOR_FLUSH_STORAGE_DURATION_SECONDS,
"Background Flusher::flush_storage duration (seconds)"
);
}