This commit is contained in:
HARSHIT KULKARNI 2026-11-07 05:48:20 +00:00 • committed by GitHub
commit bb7dfbc5ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 0 deletions

View file

@ -3097,6 +3097,12 @@ class PrometheusLogger(CustomLogger):
model_id=model_id,
api_provider=api_provider,
stream=(str(request_data.get("stream")) if litellm.prometheus_emit_stream_label else None),
service_tier=(
request_data.get("service_tier")
if isinstance(request_data.get("service_tier"), str)
and request_data.get("service_tier") in KNOWN_REQUEST_SERVICE_TIERS
else None
),
)
_label_ctx: Final = PrometheusLabelFactoryContext(enum_values)
PrometheusLogger._inc_labeled_counter(

View file

@ -515,6 +515,7 @@ class PrometheusMetricLabels:
UserAPIKeyLabelNames.USER_EMAIL.value,
UserAPIKeyLabelNames.EXCEPTION_STATUS.value,
UserAPIKeyLabelNames.EXCEPTION_CLASS.value,
UserAPIKeyLabelNames.SERVICE_TIER.value,
# ``rate_limit_category`` / ``rate_limit_type`` are appended in
# ``get_labels()`` when ``litellm.prometheus_emit_rate_limit_labels``
# is True. Kept opt-in so existing dashboards keyed on this metric's