1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Better CORS filter to allow OTEL propagator headers

This commit is contained in:
Quentin Gliech
2021-10-14 18:29:32 +02:00
parent e630279b54
commit 29f3edd833
11 changed files with 96 additions and 239 deletions

View File

@ -30,7 +30,12 @@ use opentelemetry_semantic_conventions as semcov;
pub fn setup(config: &TelemetryConfig) -> anyhow::Result<Option<Tracer>> {
global::set_error_handler(|e| tracing::error!("{}", e))?;
global::set_text_map_propagator(propagator());
let propagator = propagator();
// The CORS filter needs to know what headers it should whitelist for
// CORS-protected requests.
mas_core::filters::cors::set_propagator(&propagator);
global::set_text_map_propagator(propagator);
let tracer = tracer(&config.tracing)?;
meter(&config.metrics)?;