From 26b8133590669925722bc51ea43f72c3d6e65330 Mon Sep 17 00:00:00 2001 From: Armen Zambrano G <44410+armenzg@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:11:47 -0400 Subject: [PATCH 1/2] fix(nel): Change attribute to nel.elapsed_time While reviewing the duration in logs it became unclear if requests could take up to 17 minutes. This restores the attribute to be grouped under the `nel` prefix. --- relay-event-normalization/src/normalize/nel.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/relay-event-normalization/src/normalize/nel.rs b/relay-event-normalization/src/normalize/nel.rs index 5ff64f3495e..aae437d8990 100644 --- a/relay-event-normalization/src/normalize/nel.rs +++ b/relay-event-normalization/src/normalize/nel.rs @@ -253,7 +253,6 @@ pub fn create_log_with_trace_id( add_string_attribute!("url.domain", &url_domain); } add_attribute!("url.full", raw_report.url); - add_attribute!("http.request.duration", body.elapsed_time); add_attribute!("http.request.method", body.method); add_attribute!("http.request.header.referer", body.referrer.clone()); add_attribute!("http.response.status_code", body.status_code); @@ -280,6 +279,7 @@ pub fn create_log_with_trace_id( } // NEL-specific attributes + add_attribute!("nel.elapsed_time", body.elapsed_time); add_attribute!("nel.referrer", body.referrer); add_attribute!("nel.phase", body.phase.map_value(|s| s.to_string())); add_attribute!("nel.sampling_fraction", body.sampling_fraction); From bacfb15b887141699961990399b0481ba12466e8 Mon Sep 17 00:00:00 2001 From: Armen Zambrano G <44410+armenzg@users.noreply.github.com> Date: Tue, 8 Jul 2025 09:49:22 -0400 Subject: [PATCH 2/2] Updated snapshots --- ...lization__normalize__nel__tests__create_log_basic.snap | 8 ++++---- ...tion__normalize__nel__tests__create_log_dns_error.snap | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_basic.snap b/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_basic.snap index bd96e4ac38d..64c34be111e 100644 --- a/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_basic.snap +++ b/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_basic.snap @@ -12,10 +12,6 @@ expression: "SerializableAnnotated(&Annotated::new(log))" "type": "string", "value": "network-error" }, - "http.request.duration": { - "type": "integer", - "value": 1000 - }, "http.request.header.referer": { "type": "string", "value": "https://example.com/referer" @@ -28,6 +24,10 @@ expression: "SerializableAnnotated(&Annotated::new(log))" "type": "integer", "value": 500 }, + "nel.elapsed_time": { + "type": "integer", + "value": 1000 + }, "nel.phase": { "type": "string", "value": "application" diff --git a/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_dns_error.snap b/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_dns_error.snap index a3266263b2b..29e405c24ef 100644 --- a/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_dns_error.snap +++ b/relay-event-normalization/src/normalize/snapshots/relay_event_normalization__normalize__nel__tests__create_log_dns_error.snap @@ -12,14 +12,14 @@ expression: "SerializableAnnotated(&Annotated::new(log))" "type": "string", "value": "network-error" }, - "http.request.duration": { - "type": "integer", - "value": 2000 - }, "http.request.method": { "type": "string", "value": "POST" }, + "nel.elapsed_time": { + "type": "integer", + "value": 2000 + }, "nel.phase": { "type": "string", "value": "dns"