Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 2e81ed2

Browse files
authored
🐛 fix prometheus metric labels (#27)
This fixes a miss where I had seen usages of `.labels` `**`a dictionary into kwargs, and I accidentally passed a raw dictionary as a value instead of using keyword arguments 🤦. This caused metrics to show eg. `method="{'method':'prefill'}"` instead of `method=prefill` Signed-off-by: Joe Runde <[email protected]>
1 parent 21fb852 commit 2e81ed2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

vllm/tgis_utils/metrics.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def observe_queue_time(self, engine_output: RequestOutput):
7171
engine_output.metrics.time_in_queue)
7272

7373
def count_request_failure(self, reason: FailureReasonLabel):
74-
self.tgi_request_failure.labels({"err": reason}).inc(1)
74+
self.tgi_request_failure.labels(err=reason).inc(1)
7575

7676

7777
class TGISStatLogger(StatLogger):
@@ -120,13 +120,11 @@ def log(self, stats: Stats) -> None:
120120
self.tgi_batch_current_size.set(stats.num_running_sys)
121121

122122
for ttft in stats.time_to_first_tokens_iter:
123-
self.tgi_batch_inference_duration.labels({
124-
"method": "prefill"
125-
}).observe(ttft)
123+
self.tgi_batch_inference_duration.labels(
124+
method="prefill").observe(ttft)
126125
for tpot in stats.time_per_output_tokens_iter:
127-
self.tgi_batch_inference_duration.labels({
128-
"method": "next_token"
129-
}).observe(tpot)
126+
self.tgi_batch_inference_duration.labels(
127+
method="next_token").observe(tpot)
130128

131129
for input_len in stats.num_prompt_tokens_requests:
132130
self.tgi_request_input_length.observe(input_len)

0 commit comments

Comments
 (0)