pub struct Metrics {Show 26 fields
pub registry: Registry,
pub requests_total: CounterVec,
pub requests_shed: CounterVec,
pub requests_dropped: CounterVec,
pub errors_total: CounterVec,
pub stage_duration: HistogramVec,
pub queue_depth: IntGaugeVec,
pub inference_cost_usd: Counter,
pub ttft_seconds: HistogramVec,
pub dedup_hits_total: Counter,
pub dedup_waiters_unblocked_total: Counter,
pub inference_timeouts_total: Counter,
pub requests_expired_total: Counter,
pub dlq_lock_poisoned_total: Counter,
pub rag_requests_expired_total: Counter,
pub circuit_breaker_state_transitions_total: CounterVec,
pub circuit_breaker_requests_rejected_total: Counter,
pub config_reload_errors_total: Counter,
pub worker_errors_total: CounterVec,
pub cache_hits_total: Counter,
pub cache_misses_total: Counter,
pub rate_limiter_tokens_remaining: GaugeVec,
pub config_reload_duration_seconds: HistogramVec,
pub session_affinity_hits_total: Counter,
pub session_affinity_misses_total: Counter,
pub dedup_hash_collisions_total: Counter,
}Expand description
All Prometheus metrics for the orchestrator, bundled together so they can
be stored in a single OnceLock and initialised atomically.
Fields§
§registry: RegistryPrometheus registry that owns all metric descriptors.
requests_total: CounterVecTotal requests processed per stage.
requests_shed: CounterVecRequests shed (queue full) per stage.
requests_dropped: CounterVecRequests dropped due to full queue, labelled by stage.
errors_total: CounterVecErrors by stage and error type.
stage_duration: HistogramVecStage processing latency histogram.
queue_depth: IntGaugeVecCurrent queue depth per stage.
inference_cost_usd: CounterCumulative USD cost of all inference calls.
ttft_seconds: HistogramVecTime from request start to first streaming token, labelled by worker and model.
dedup_hits_total: CounterTotal dedup hits (in-progress or cached responses returned without new inference).
dedup_waiters_unblocked_total: CounterTotal dedup waiters unblocked (requests that waited and received a broadcast result).
inference_timeouts_total: CounterTotal inference timeouts.
requests_expired_total: CounterRequests dropped because their deadline had already passed at dequeue time.
dlq_lock_poisoned_total: CounterIncremented when a DeadLetterQueue mutex is recovered from a poisoned state.
rag_requests_expired_total: CounterIncremented when a RAG-stage request is dropped because its deadline expired.
circuit_breaker_state_transitions_total: CounterVecCircuit breaker state transitions, labelled by target state.
circuit_breaker_requests_rejected_total: CounterRequests rejected by the circuit breaker (open state).
config_reload_errors_total: CounterConfig hot-reload attempts that failed validation or parse.
worker_errors_total: CounterVecErrors returned by a specific named worker, labelled by worker name.
cache_hits_total: CounterCache hits on the response cache (in-memory or Redis).
cache_misses_total: CounterCache misses on the response cache (in-memory or Redis).
rate_limiter_tokens_remaining: GaugeVecCurrent number of tokens remaining in the rate-limiter bucket per session.
config_reload_duration_seconds: HistogramVecDuration of config hot-reload operations (parse + validate), in seconds.
session_affinity_hits_total: CounterSession affinity routing hits (request routed to its preferred shard).
session_affinity_misses_total: CounterSession affinity routing misses (preferred shard unavailable, rerouted).
dedup_hash_collisions_total: CounterDedup hash collisions: two different prompts produced the same hash key.
Auto Trait Implementations§
impl !RefUnwindSafe for Metrics
impl !UnwindSafe for Metrics
impl Freeze for Metrics
impl Send for Metrics
impl Sync for Metrics
impl Unpin for Metrics
impl UnsafeUnpin for Metrics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request