Skip to content

ranger-ross/reqwest-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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.

About

Metrics.rs integration for reqwest

Resources

License

Stars

Watchers

Forks

Languages