1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-12-06 22:40:58 +03:00

Sentry transport based on hyper to get rid of reqwest

This commit is contained in:
Quentin Gliech
2023-04-18 22:03:17 +02:00
parent 70b03a131f
commit c9e9130cdf
6 changed files with 447 additions and 91 deletions

View File

@@ -17,6 +17,8 @@
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions)]
use std::sync::Arc;
use anyhow::Context;
use clap::Parser;
use mas_config::TelemetryConfig;
@@ -25,7 +27,10 @@ use tracing_subscriber::{
filter::LevelFilter, layer::SubscriberExt, util::SubscriberInitExt, EnvFilter, Layer, Registry,
};
use crate::sentry_transport::HyperTransportFactory;
mod commands;
mod sentry_transport;
mod server;
mod telemetry;
mod util;
@@ -70,6 +75,9 @@ async fn try_main() -> anyhow::Result<()> {
let sentry = sentry::init((
telemetry_config.sentry.dsn.as_deref(),
sentry::ClientOptions {
transport: Some(Arc::new(HyperTransportFactory::new(
mas_http::make_untraced_client().await?,
))),
traces_sample_rate: 1.0,
auto_session_tracking: true,
session_mode: sentry::SessionMode::Request,