2 unstable releases
| 0.2.0 | Sep 22, 2025 |
|---|---|
| 0.1.0 | May 18, 2025 |
#583 in HTTP server
1,387 downloads per month
23KB
251 lines
reqwest-metrics
Metrics.rs integration for reqwest using reqwest-middleware
Features
- Adheres to Open Telemetry HTTP Client Semantic Conventions
- Customizable labels
Usage
let client = ClientBuilder::new(reqwest::Client::new())
.with(MetricsMiddleware::new())
.build();
Configuration
Overriding label names
let client = ClientBuilder::new(reqwest::Client::new())
.with(
MetricsMiddleware::builder()
.http_request_method_label("method")
.http_response_status_label("status")
.server_address_label("host")
.build(),
)
.build();
Supported metrics:
Supported labels:
http_request_methodserver_addressserver_porterror_typehttp_response_status_codenetwork_protocol_namenetwork_protocol_versionurl_scheme
Motivation
This crate is heavily inspired by the HTTP Client metrics provided by Spring. This crate aims to provide the same functionality while adhereing to Otel semantic conventions.
Dependencies
~5–19MB
~198K SLoC