2 releases
0.1.1 | Aug 13, 2024 |
---|---|
0.1.0 | Aug 13, 2024 |
#899 in HTTP server
24 downloads per month
8KB
152 lines
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,
}
Dependencies
~9–18MB
~246K SLoC