8 views
-/https://github.com/berriai/litellm/issues/33676
GitHub · issue

#33676 [Bug]: Prometheus /metrics endpoint incorrectly redirects

  • State: open
  • Author: @MathisHammel
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Very minor bug, but should be equally easy to fix.

The standard metrics endpoint [as documented by Prometheus](https://prometheus.io/docs/prometheus/latest/configuration/configuration/) is `/metrics`. The [LiteLLM docs](https://docs.litellm.ai/docs/proxy/prometheus) also reference `/metrics`.

However, when sending a GET request to this endpoint on a LiteLLM gateway, it redirects to `/metrics/` (with a trailing slash) which is the endpoint actually used by the server. This causes unnecessary network traffic and duplicates logs.

### Steps to Reproduce

1. Deploy a LiteLLM gateway with prometheus metrics enabled 2. Send a GET request to `/metrics` 3. See that you are redirected to the non-standard endpoint `/metrics/`

### Relevant log output

```shell Jul 17 11:14:08 litellm litellm[285175]: INFO: 192.168.1.133:36900 - "GET /metrics/ HTTP/1.1" 200 OK Jul 17 11:14:23 litellm litellm[285175]: INFO: 192.168.1.133:59894 - "GET /metrics HTTP/1.1" 307 Temporary Redirect Jul 17 11:14:23 litellm litellm[285175]: INFO: 192.168.1.133:59894 -…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h38m28s ago — entered · #import:https:::github.com:berriai:litellm post #2238
The dashboard work requires tracing configuration data through rendering and clipboard-generation paths, handling UI state and validation, and adding coverage; the endpoint fix is comparatively localized to routing behavior with focused regression testing.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search