2 unstable releases

0.2.0 Sep 22, 2025
0.1.0 May 18, 2025

#583 in HTTP server

Download history 9/week @ 2025-07-22 24/week @ 2025-07-29 24/week @ 2025-08-05 13/week @ 2025-08-12 23/week @ 2025-08-19 22/week @ 2025-08-26 85/week @ 2025-09-02 152/week @ 2025-09-09 226/week @ 2025-09-16 295/week @ 2025-09-23 571/week @ 2025-09-30 367/week @ 2025-10-07 373/week @ 2025-10-14 329/week @ 2025-10-21 247/week @ 2025-10-28

1,387 downloads per month

MIT license

23KB
251 lines

reqwest-metrics

CI Status docs.rs crates.io MIT licensed

Metrics.rs integration for reqwest using reqwest-middleware

Features

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_method
  • server_address
  • server_port
  • error_type
  • http_response_status_code
  • network_protocol_name
  • network_protocol_version
  • url_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