Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
601f856d
Unverified
Commit
601f856d
authored
Jul 30, 2025
by
Bram
Committed by
GitHub
Jul 30, 2025
Browse files
[Bugfix] Fix None value handling in trace span creation for cancelled requests (#20272)
parent
287f527f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
vllm/engine/llm_engine.py
vllm/engine/llm_engine.py
+20
-7
No files found.
vllm/engine/llm_engine.py
View file @
601f856d
...
...
@@ -1862,8 +1862,14 @@ class LLMEngine:
context
=
trace_context
,
start_time
=
arrival_time_nano_seconds
)
as
seq_span
:
metrics
=
seq_group
.
metrics
ttft
=
metrics
.
first_token_time
-
metrics
.
arrival_time
e2e_time
=
metrics
.
finished_time
-
metrics
.
arrival_time
# Handle potential None values for cancelled/aborted requests
ttft
=
(
metrics
.
first_token_time
-
metrics
.
arrival_time
if
metrics
.
first_token_time
is
not
None
else
None
)
e2e_time
=
(
metrics
.
finished_time
-
metrics
.
arrival_time
if
metrics
.
finished_time
is
not
None
else
None
)
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_RESPONSE_MODEL
,
self
.
model_config
.
model
)
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_REQUEST_ID
,
...
...
@@ -1886,11 +1892,18 @@ class LLMEngine:
seq
.
get_output_len
()
for
seq
in
seq_group
.
get_finished_seqs
()
]))
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_TIME_IN_QUEUE
,
# Only set timing attributes if the values are available
if
metrics
.
time_in_queue
is
not
None
:
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_TIME_IN_QUEUE
,
metrics
.
time_in_queue
)
if
ttft
is
not
None
:
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_TIME_TO_FIRST_TOKEN
,
ttft
)
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_E2E
,
e2e_time
)
if
e2e_time
is
not
None
:
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_E2E
,
e2e_time
)
if
metrics
.
scheduler_time
is
not
None
:
seq_span
.
set_attribute
(
SpanAttributes
.
GEN_AI_LATENCY_TIME_IN_SCHEDULER
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment