[Metrics] Count finished requests by watermark status (#58715)
Signed-off-by: Simon Veitner <sveitner@redhat.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Lucas Wilkinson <LucasWilkinson@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude
Lucas Wilkinson
parent
45bb710eca
commit
a7b7bc1fbe
@@ -11,6 +11,7 @@ import pytest
|
||||
|
||||
from vllm.config import ModelConfig, VllmConfig
|
||||
from vllm.config.observability import ObservabilityConfig
|
||||
from vllm.config.watermarking import WatermarkConfig
|
||||
from vllm.v1.metrics.buckets import (
|
||||
BUCKET_FAMILY_KEYS,
|
||||
build_1_2_5_buckets,
|
||||
@@ -317,3 +318,16 @@ def test_prometheus_logger_applies_overrides():
|
||||
assert found[metric_name] == overridden[family], metric_name
|
||||
finally:
|
||||
unregister_vllm_metrics()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("with_config", [True, False])
|
||||
def test_watermark_requests_counter_registration(with_config: bool):
|
||||
"""The watermark counter must exist only with watermark_config."""
|
||||
config = build_logger_config(ObservabilityConfig())
|
||||
config.watermark_config = WatermarkConfig(key=42) if with_config else None
|
||||
try:
|
||||
PrometheusStatLogger(config)
|
||||
names = {m.name for m in prometheus_client.REGISTRY.collect()}
|
||||
assert ("vllm:watermark_requests" in names) == with_config
|
||||
finally:
|
||||
unregister_vllm_metrics()
|
||||
|
||||
Reference in New Issue
Block a user