From 99ecde774417cde65cfebc14763468a4eea372e5 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 7 Aug 2024 10:36:18 -0700 Subject: [PATCH] allow setting outage metrics --- litellm/integrations/prometheus.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index 0865f64eed5..0c8df96bfb5 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -315,6 +315,22 @@ class PrometheusLogger: except: pass + def set_llm_outage_metric( + self, + litellm_model_name: str, + model_id: str, + api_base: str, + llm_provider: str, + ): + """ + log these labels + ["litellm_model_name", "model_id", "api_base", "api_provider"] + """ + self.deployment_unhealthy.labels( + litellm_model_name, model_id, api_base, llm_provider + ).set(1) + pass + def set_llm_deployment_success_metrics(self, request_kwargs: dict): try: verbose_logger.debug("setting remaining tokens requests metric")