From 50cc7c03538b5679cadb55cee5eb04b635fdeb79 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 18 Sep 2024 16:28:12 -0700 Subject: [PATCH] [Chore LiteLLM Proxy] enforce prometheus metrics as enterprise feature (#5769) * enforce prometheus as enterprise feature * show correct error on prometheus metric when not enrterprise user * docs promethues metrics enforced * fix enforcing --- docs/my-website/docs/proxy/prometheus.md | 3 ++- litellm/integrations/prometheus.py | 14 +++++++++++--- litellm/proxy/proxy_config.yaml | 10 ---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/my-website/docs/proxy/prometheus.md b/docs/my-website/docs/proxy/prometheus.md index 71af4f40d..b8db542c9 100644 --- a/docs/my-website/docs/proxy/prometheus.md +++ b/docs/my-website/docs/proxy/prometheus.md @@ -4,7 +4,8 @@ import TabItem from '@theme/TabItem'; # 📈 [BETA] Prometheus metrics :::info -🚨 Prometheus metrics will be out of Beta on September 15, 2024 - as part of this release it will be on LiteLLM Enterprise starting at $250/mo + +✨ Prometheus metrics is on LiteLLM Enterprise starting at $250/mo [Enterprise Pricing](https://www.litellm.ai/#pricing) diff --git a/litellm/integrations/prometheus.py b/litellm/integrations/prometheus.py index 5fb69a90a..ec5e0522c 100644 --- a/litellm/integrations/prometheus.py +++ b/litellm/integrations/prometheus.py @@ -26,9 +26,17 @@ class PrometheusLogger(CustomLogger): try: from prometheus_client import Counter, Gauge, Histogram - verbose_logger.warning( - "🚨🚨🚨 Prometheus Metrics will be moving to LiteLLM Enterprise on September 15th, 2024.\n🚨 Contact us here to get a license https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat \n🚨 Enterprise Pricing: https://www.litellm.ai/#pricing" - ) + from litellm.proxy.proxy_server import CommonProxyErrors, premium_user + + if premium_user is not True: + verbose_logger.warning( + f"🚨🚨🚨 Prometheus Metrics is on LiteLLM Enterprise\n🚨 {CommonProxyErrors.not_premium_user.value}" + ) + self.litellm_not_a_premium_user_metric = Counter( + name="litellm_not_a_premium_user_metric", + documentation=f"🚨🚨🚨 Prometheus Metrics is on LiteLLM Enterprise. 🚨 {CommonProxyErrors.not_premium_user.value}", + ) + return self.litellm_llm_api_failed_requests_metric = Counter( name="litellm_llm_api_failed_requests_metric", diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index 431f8816b..09ba66167 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -6,16 +6,6 @@ model_list: api_base: https://exampleopenaiendpoint-production.up.railway.app -assistant_settings: - custom_llm_provider: azure - litellm_params: - api_key: os.environ/AZURE_API_KEY - api_base: os.environ/AZURE_API_BASE - - -general_settings: - master_key: sk-1234 - litellm_settings: