diff --git a/docs/my-website/docs/proxy/grafana_metrics.md b/docs/my-website/docs/proxy/grafana_metrics.md index 80dd11698..bc099b51a 100644 --- a/docs/my-website/docs/proxy/grafana_metrics.md +++ b/docs/my-website/docs/proxy/grafana_metrics.md @@ -4,6 +4,8 @@ LiteLLM Exposes a `/metrics` endpoint for Prometheus to Poll ## Quick Start +If you're using the LiteLLM CLI with `litellm --config proxy_config.yaml` then you need to `pip install prometheus_client==0.20.0`. **This is already pre-installed on the litellm Docker image** + Add this to your proxy config.yaml ```yaml model_list: @@ -34,6 +36,12 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \ }' ``` +View Metrics on `/metrics`, Visit `http://localhost:4000/metrics` +```shell +http://localhost:4000/metrics + +# /metrics +``` ## Metrics Tracked diff --git a/litellm/proxy/proxy_config.yaml b/litellm/proxy/proxy_config.yaml index f5f05891e..4827c753a 100644 --- a/litellm/proxy/proxy_config.yaml +++ b/litellm/proxy/proxy_config.yaml @@ -43,8 +43,5 @@ model_list: model: openai/fake api_key: fake-key api_base: https://exampleopenaiendpoint-production.up.railway.app/ -general_settings: - master_key: sk-1234 - disable_spend_logs: true - disable_reset_budget: true - num_retries: 2 \ No newline at end of file +litellm_settings: + success_callback: ["prometheus"] \ No newline at end of file diff --git a/litellm/utils.py b/litellm/utils.py index 2b73c0b8f..0001ba760 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -6235,7 +6235,8 @@ def set_callbacks(callback_list, function_id=None): elif callback == "datadog": dataDogLogger = DataDogLogger() elif callback == "prometheus": - prometheusLogger = PrometheusLogger() + if prometheusLogger is None: + prometheusLogger = PrometheusLogger() elif callback == "dynamodb": dynamoLogger = DyanmoDBLogger() elif callback == "s3":