2 releases

0.1.1 Aug 13, 2024
0.1.0 Aug 13, 2024

#588 in HTTP server

GPL-2.0-or-later

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
~245K SLoC