mas_http/
lib.rs

1// Copyright 2024 New Vector Ltd.
2// Copyright 2022-2024 The Matrix.org Foundation C.I.C.
3//
4// SPDX-License-Identifier: AGPL-3.0-only
5// Please see LICENSE in the repository root for full details.
6
7//! Utilities to do HTTP requests
8
9#![deny(rustdoc::missing_crate_level_docs)]
10#![allow(clippy::module_name_repetitions)]
11
12use std::sync::LazyLock;
13
14mod ext;
15mod reqwest;
16
17pub use self::{
18    ext::{CorsLayerExt, set_propagator},
19    reqwest::{RequestBuilderExt, client as reqwest_client},
20};
21
22static METER: LazyLock<opentelemetry::metrics::Meter> = LazyLock::new(|| {
23    let scope = opentelemetry::InstrumentationScope::builder(env!("CARGO_PKG_NAME"))
24        .with_version(env!("CARGO_PKG_VERSION"))
25        .with_schema_url(opentelemetry_semantic_conventions::SCHEMA_URL)
26        .build();
27
28    opentelemetry::global::meter_with_scope(scope)
29});