Crates.io | http_metware |
lib.rs | http_metware |
version | 0.1.1 |
source | src |
created_at | 2024-08-13 20:50:51.395983 |
updated_at | 2024-08-13 21:02:35.803445 |
description | Http metrics |
homepage | |
repository | https://github.com/stepanpopov/http_metware |
max_upload_size | |
id | 1336499 |
size | 7,515 |
This tower middleware can be usefull to easily integrate http metrics into your web server. It doesnt rely on any metrics lib, all you have to do is to access ExposedMetrics via MetricsExposer trait implemetation and log them or collect via any metrics lib like prometheus client.
pub struct ExposedMetrics<'a> {
pub uri: &'a Uri,
pub method: &'a str,
pub status_code: u16,
pub elapsed_time: &'a Duration,
}