From 87d4c312c84f20b5abbc56c71abb69af10f7d381 Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Mon, 23 Mar 2026 19:49:54 -0700 Subject: [PATCH] fix(prometheus): include custom metadata and tag labels in known_labels to avoid false-positive warnings --- litellm/integrations/prometheus.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index 163a66144af..f0f5d506eba 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -504,6 +504,11 @@ class PrometheusLogger(CustomLogger): "error_type", "hook_type", } + # Include dynamic custom labels so we don't warn on valid user-defined names. + known_labels.update(litellm.custom_prometheus_metadata_labels or []) + known_labels.update( + f"tag_{tag}" for tag in (litellm.custom_prometheus_tags or []) + ) for name in raw_metrics: if name not in defined_metrics: verbose_logger.warning(