Re-exports§
pub use scopeguard;
Modules§
- histogram
- metered_
channel - monitored_
mpsc - Provides wrappers to tokio mpsc channels, with metrics on total items sent, received and inflight.
- thread_
stall_ monitor
Macros§
Structs§
- Cancel
Monitor - Gauge
Guard - Increments gauge when acquired, decrements when guard drops
- Inflight
Guard - Difference vs GaugeGuard: Stores the gauge by value to avoid borrowing issues.
- Inflight
Guard Future - Metrics
- Monitored
Scope Future - Monitored
Scope Guard - Registry
Service - A service to manage the prometheus registries. This service allow us to create a new Registry on demand and keep it accessible for processing/polling. The service can be freely cloned/shared across threads.
Constants§
- BYTES_
BUCKETS - COARSE_
LATENCY_ SEC_ BUCKETS - Used when we don’t care about fine-grained values.
- COUNT_
BUCKETS - LATENCY_
SEC_ BUCKETS - Used when latency is usually < 10s. Expensive because of the number of buckets.
- METRICS_
ROUTE - SUBSECOND_
LATENCY_ SEC_ BUCKETS - Used when latency is most definitely sub-second.
- TX_
TYPE_ SHARED_ OBJ_ TX - TX_
TYPE_ SINGLE_ WRITER_ TX
Traits§
- Inflight
Guard Future Ext - Monitor
Cancellation - MonitorCancellation records a cancelled = true span attribute if the future it is decorating is dropped before completion. The cancelled attribute must be added at span creation, as you cannot add new attributes after the span is created.
- Monitored
Future Ext
Functions§
- add_
server_ timing - Add a new entry to the ServerTiming header.
If the caller is not currently in a ServerTiming context (created with
with_new_server_timing), an error is logged. - bridge_
uptime_ metric - Similar to
uptime_metric, but for the bridge node with different labels. Create a metric that measures the uptime from when this metric was constructed. The metric is labeled with: - get_
metrics - get_
server_ timing - Get the currently active ServerTiming context. Only intended for use by macros within this module.
- init_
metrics - metrics
- monitored_
scope - This function creates a named scoped object, that keeps track of
- start_
prometheus_ server - uptime_
metric - Create a metric that measures the uptime from when this metric was constructed. The metric is labeled with:
- with_
new_ server_ timing - Create a new task-local ServerTiming context and run the provided future within it. Should be used at the top-most level of a request handler. Can be added to an axum router as a layer by using mysten_service::server_timing_middleware.
- with_
server_ timing - Create a new task-local ServerTiming context and run the provided future within it. Only intended for use by macros within this module.