diff --git a/docs/my-website/docs/proxy/grafana_metrics.md b/docs/my-website/docs/proxy/grafana_metrics.md new file mode 100644 index 000000000..80dd11698 --- /dev/null +++ b/docs/my-website/docs/proxy/grafana_metrics.md @@ -0,0 +1,45 @@ +# Grafana, Prometheus metrics [BETA] + +LiteLLM Exposes a `/metrics` endpoint for Prometheus to Poll + +## Quick Start + +Add this to your proxy config.yaml +```yaml +model_list: + - model_name: gpt-3.5-turbo + litellm_params: + model: gpt-3.5-turbo +litellm_settings: + success_callback: ["prometheus"] +``` + +Start the proxy +```shell +litellm --config config.yaml --debug +``` + +Test Request +```shell +curl --location 'http://0.0.0.0:4000/chat/completions' \ + --header 'Content-Type: application/json' \ + --data '{ + "model": "gpt-3.5-turbo", + "messages": [ + { + "role": "user", + "content": "what llm are you" + } + ] +}' +``` + + +## Metrics Tracked + + +| Metric Name | Description | +|----------------------|--------------------------------------| +| `litellm_requests_metric` | Number of requests made, per `"user", "key", "model"` | +| `litellm_spend_metric` | Total Spend, per `"user", "key", "model"` | +| `litellm_total_tokens` | input + output tokens per `"user", "key", "model"` | diff --git a/docs/my-website/sidebars.js b/docs/my-website/sidebars.js index dc6eca314..2cfef4687 100644 --- a/docs/my-website/sidebars.js +++ b/docs/my-website/sidebars.js @@ -68,6 +68,7 @@ const sidebars = { "proxy/streaming_logging", ] }, + "proxy/grafana_metrics", "proxy/call_hooks", "proxy/rules", "proxy/cli",