From 9ea712dfd0c04996483d575ee61d2ab6aef81ef8 Mon Sep 17 00:00:00 2001 From: Rory Neithinger Date: Thu, 9 Nov 2023 16:53:25 -0800 Subject: [PATCH] always use x-amzn-trace-id even if not ulid --- web3_proxy/src/jsonrpc/request_builder.rs | 9 +-------- web3_proxy/src/kafka.rs | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/web3_proxy/src/jsonrpc/request_builder.rs b/web3_proxy/src/jsonrpc/request_builder.rs index ef3c4a8e..b5716ac4 100644 --- a/web3_proxy/src/jsonrpc/request_builder.rs +++ b/web3_proxy/src/jsonrpc/request_builder.rs @@ -404,19 +404,12 @@ impl ValidatedRequest { ) -> Web3ProxyResult> { #[cfg(feature = "rdkafka")] let kafka_debug_logger = if matches!(authorization.checks.proxy_mode, ProxyMode::Debug) { - let request_ulid = request_id - .map(|s| Ulid::from_string(&s)) - .transpose() - .ok() - .flatten() - .unwrap_or_else(Ulid::new); - KafkaDebugLogger::try_new( app, authorization.clone(), head_block.as_ref().map(|x| x.number()), "web3_proxy:rpc", - request_ulid, + &request_id, ) } else { None diff --git a/web3_proxy/src/kafka.rs b/web3_proxy/src/kafka.rs index d4c34ed1..fa26bd33 100644 --- a/web3_proxy/src/kafka.rs +++ b/web3_proxy/src/kafka.rs @@ -37,7 +37,7 @@ impl KafkaDebugLogger { authorization: Arc, head_block_num: Option, kafka_topic: &str, - request_ulid: Ulid, + request_id: &str, ) -> Option> { let kafka_producer = app.kafka_producer.clone()?; @@ -74,7 +74,7 @@ impl KafkaDebugLogger { }) .insert(KafkaHeader { key: "request_ulid", - value: Some(&request_ulid.to_string()), + value: Some(request_id), }) .insert(KafkaHeader { key: "head_block_num",