Skip to content

Conversation

@shivamrawat1
Copy link
Contributor

Relevant issues

The custom_prometheus_metadata_labels feature could only extract labels from nested metadata dictionaries (requester_metadata, user_api_key_auth_metadata), but not from top-level metadata fields like requester_ip_address.

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • [] My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
✅ Test

Changes

Modified litellm/integrations/prometheus.py to include top-level metadata fields in combined_metadata. The code now:

  • Extracts all top-level non-dictionary fields from metadata
  • Merges them with nested metadata contents (requester_metadata and user_api_key_auth_metadata)

This enables get_custom_labels_from_metadata() to access fields like requester_ip_address directly from top-level metadata.

@vercel
Copy link

vercel bot commented Dec 17, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
litellm Ready Ready Preview, Comment Dec 17, 2025 1:27am

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@krrishdholakia krrishdholakia changed the base branch from main to litellm_staging_12_17_2025 December 17, 2025 05:47
@krrishdholakia krrishdholakia merged commit 14a4a9c into BerriAI:litellm_staging_12_17_2025 Dec 17, 2025
4 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants