From c4892fff93841844ed78f85f723d1b383d9f0b38 Mon Sep 17 00:00:00 2001 From: Ava Hahn Date: Tue, 7 Jan 2025 15:27:26 -0800 Subject: otel: remove deadcode The superfluous else condition in nxt_otel_propagate_header was dead code. This commit removes it. Signed-off-by: Ava Hahn --- src/nxt_otel.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src') diff --git a/src/nxt_otel.c b/src/nxt_otel.c index ef796a7c..38ef02ea 100644 --- a/src/nxt_otel.c +++ b/src/nxt_otel.c @@ -67,7 +67,7 @@ nxt_otel_propagate_header(nxt_task_t *task, nxt_http_request_t *r) * if we didn't inherit a trace id then we need to add the * traceparent header to the request */ - } else if (r->otel->trace_id == NULL) { + } else { nxt_otel_rs_copy_traceparent(traceval, r->otel->trace); @@ -92,15 +92,6 @@ nxt_otel_propagate_header(nxt_task_t *task, nxt_http_request_t *r) nxt_otel_rs_add_event_to_trace(r->otel->trace, &traceparent_name, &traceparent); - - /* - * potentially nxt_http_request_error called before headers - * finished parsing - */ - } else { - nxt_log(task, NXT_LOG_DEBUG, - "not propagating tracing headers for missing trace"); - return; } f = nxt_list_add(r->resp.fields); -- cgit