Module prometheus

Module prometheus 

Source
Expand description

Prometheus backend for shared Aster infrastructure metrics.

This module is enabled by the prometheus feature. Product crates can use init_or_noop to obtain a SharedMetricsRecorder and export_metrics for their HTTP metrics endpoint without depending on the prometheus crate directly. Product-specific metric families can be registered with Forge descriptors and recorded through opaque handles, so products keep ownership of domain labels without importing Prometheus types.

Structs§

ProductCounter
Typed handle for a registered product counter.
ProductGauge
Typed handle for a registered product gauge.
ProductHistogram
Typed handle for a registered product histogram.
ProductMetricHandle
Opaque handle returned after registering a product metric.
PrometheusMetrics
Prometheus metric families for product-neutral Aster infrastructure.
PrometheusMetricsRecorder
Prometheus recorder for shared infrastructure metrics.

Enums§

ProductMetricError
Errors returned by product metric registration or recording.

Functions§

add_product_gauge
Adds to a registered product gauge.
export_metrics
Exports the current Prometheus text exposition body.
inc_product_counter
Increments a registered product counter.
init_metrics
Initializes the shared Prometheus registry.
init_or_noop
Initializes Prometheus metrics and falls back to a no-op recorder on failure.
is_initialized
Returns whether the Prometheus registry has been initialized.
observe_product_histogram
Observes a registered product histogram.
record_health_component
Records one health component into the shared Prometheus registry.
record_health_report
Records an aggregate health report into the shared Prometheus registry.
register_product_counter
Registers a product counter and returns a typed handle.
register_product_gauge
Registers a product gauge and returns a typed handle.
register_product_histogram
Registers a product histogram and returns a typed handle.
register_product_metric
Registers a product-owned metric family in the shared Prometheus registry.
register_product_metrics
Registers multiple product-owned metric families in order.
set_product_gauge
Sets a registered product gauge.

Type Aliases§

ProductMetricResult
Result type for product metric operations.