Registry / observability / actix-web-prom

actix-web-prom

JSON →
library0.10.0rscratesunverified

Actix Web middleware to expose Prometheus metrics.

# Cargo.toml [dependencies] actix-web-prom = "0.10.0"
INSTALL
IMPORT
SIG · ACTIX-WEB-PROM
A
actix-web-prom
observabilityrustv0.10.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrometheusMetrics
use actix_web_prom::PrometheusMetrics;

Sets up an Actix Web server with Prometheus metrics middleware.

use actix_web::{web, App, HttpServer}; use actix_web_prom::PrometheusMetrics; #[actix_web::main] async fn main() -> std::io::Result<()> { let prometheus = PrometheusMetrics::new("api", None); HttpServer::new(move || { App::new() .wrap(prometheus.clone()) .route("/metrics", web::get().to(|| async { "metrics" })) }) .bind("127.0.0.1:8080")? .run() .await }
Debug
Known issues
gotchaRequires the `actix-web` runtime; ensure you are using the correct async runtime.
fix
Use `#[actix_web::main]` or manually set up the Actix system.
affects: >=0.10.0
Upgrade
Version history
0.10.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
52 hits · last 30 days
node
40
OpenAI (training)
2
Resources