1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Replace the OTEL-based tracing layer with tracing based layers

This commit is contained in:
Quentin Gliech
2023-04-15 14:21:12 +02:00
parent 4a4fbc7a16
commit 08f58db08b
47 changed files with 1703 additions and 1520 deletions

View File

@@ -27,7 +27,10 @@ use mas_storage::job::{JobWithSpanContext, VerifyEmailJob};
use rand::{distributions::Uniform, Rng};
use tracing::info;
use crate::{layers::TracingLayer, JobContextExt, State};
use crate::{
utils::{metrics_layer, trace_layer},
JobContextExt, State,
};
#[tracing::instrument(
name = "job.verify_email",
@@ -98,7 +101,8 @@ pub(crate) fn register(
let worker_name = format!("{job}-{suffix}", job = VerifyEmailJob::NAME);
let worker = WorkerBuilder::new(worker_name)
.layer(state.inject())
.layer(TracingLayer::new())
.layer(trace_layer::<VerifyEmailJob>())
.layer(metrics_layer::<JobWithSpanContext<VerifyEmailJob>>())
.with_storage(storage)
.build_fn(verify_email);
monitor.register(worker)