mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
* feat(prometheus): add global exclude_metrics and exclude_labels options Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(prometheus): apply global exclude_labels to hard-coded metric labels Metrics built with hard-coded labelnames lists (guardrail, provider budget, callback, managed file/batch, batch cost) bypassed prometheus_exclude_labels because only labels resolved via get_labels_for_metric were filtered. Route every metric through a factory that strips excluded labels at construction and proxies labels() so excluded labels are dropped at emission too. Add the non-enum hard-coded labels (guardrail_name, status, error_type, hook_type, purpose, file_type, result) to exclude-config validation so they are accepted instead of raising ValueError at logger init. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(prometheus): simplify exclude-label factory to the kwargs labelnames path All metric definitions pass labelnames as a keyword argument, and the only metrics that pass it positionally resolve their labels through get_labels_for_metric, which already drops excluded labels, so they never carry an excluded label into the factory. Drop the unreachable positional reconstruction branch. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore: re-trigger CI (flaky unrelated bedrock agentcore test) Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(prometheus): use immutable constructions to satisfy LIT002 budget Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: shivam <shivam@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| test_custom_guardrail.py | ||
| test_prometheus.py | ||
| test_prometheus_unit_tests.py | ||