mirror of
https://github.com/katanemo/plano.git
synced 2026-05-14 18:42:38 +02:00
fix: read request_id and traceparent early in on_http_request_headers
Fixes #643 Move request_id and traceparent initialization to the start of on_http_request_headers so that all subsequent log messages within the same handler (including select_llm_provider) carry the correct request ID instead of showing 'no_request_id'.
This commit is contained in:
parent
978b1ea722
commit
68b452b71a
1 changed files with 4 additions and 3 deletions
|
|
@ -809,6 +809,10 @@ impl HttpContext for StreamContext {
|
|||
return Action::Continue;
|
||||
}
|
||||
|
||||
// Capture request ID and traceparent early so all subsequent log messages include them
|
||||
self.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
||||
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
||||
|
||||
// Capture HTTP method and protocol for tracing
|
||||
self.http_method = self.get_http_request_header(":method");
|
||||
self.http_protocol = self.get_http_request_header(":scheme");
|
||||
|
|
@ -884,9 +888,6 @@ impl HttpContext for StreamContext {
|
|||
self.delete_content_length_header();
|
||||
self.save_ratelimit_header();
|
||||
|
||||
self.request_id = self.get_http_request_header(REQUEST_ID_HEADER);
|
||||
self.traceparent = self.get_http_request_header(TRACE_PARENT_HEADER);
|
||||
|
||||
Action::Continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue