mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-30 06:43:27 +00:00
test: seed exclude_metrics/exclude_labels on bare PrometheusLogger test double
This commit is contained in:
parent
17719e412d
commit
731b19edf8
1 changed files with 7 additions and 3 deletions
|
|
@ -16,9 +16,13 @@ from litellm.types.integrations.prometheus import (
|
|||
|
||||
def _bare_logger() -> PrometheusLogger:
|
||||
"""A PrometheusLogger instance with __init__ skipped, for testing the
|
||||
config-parsing helpers in isolation without re-registering ~70 real
|
||||
metrics against prometheus_client's global registry on every test."""
|
||||
return PrometheusLogger.__new__(PrometheusLogger)
|
||||
config-parsing helpers in isolation. Manually seeds exclude_metrics/
|
||||
exclude_labels since __init__ (which normally sets them via
|
||||
_parse_exclude_config) never runs here."""
|
||||
logger = PrometheusLogger.__new__(PrometheusLogger)
|
||||
logger.exclude_metrics = frozenset()
|
||||
logger.exclude_labels = frozenset()
|
||||
return logger
|
||||
|
||||
|
||||
def test_wildcard_sets_default_labels_for_every_metric():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue