{"record":{"id":"edf87ae54fe55136","repo":"BerriAI/litellm","slug":"prometheus-exclude-configuration-validation-failed","errorCode":null,"errorMessage":"Prometheus exclude configuration validation failed:\n{errors}","messagePattern":"Prometheus exclude configuration validation failed:\n(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/prometheus.py","lineNumber":738,"sourceCode":"        from typing import get_args\n\n        import litellm\n\n        exclude_metrics: Final = frozenset(litellm.prometheus_exclude_metrics or ())\n        exclude_labels: Final = frozenset(litellm.prometheus_exclude_labels or ())\n\n        valid_metrics: Final = frozenset(get_args(DEFINED_PROMETHEUS_METRICS))\n        invalid_metrics: Final = sorted(exclude_metrics - valid_metrics)\n\n        valid_labels: Final = self._all_defined_labels()\n        invalid_labels: Final = sorted(exclude_labels - valid_labels)\n\n        errors: Final = (\n            *(f\"Invalid metric name in prometheus_exclude_metrics: {metric}\" for metric in invalid_metrics),\n            *(f\"Invalid label name in prometheus_exclude_labels: {label}\" for label in invalid_labels),\n        )\n        if errors:\n            raise ValueError(\"Prometheus exclude configuration validation failed:\\n\" + \"\\n\".join(errors))\n\n        return exclude_metrics, exclude_labels\n\n    @staticmethod\n    def _all_defined_labels() -> frozenset[str]:\n        \"\"\"Every label a metric can emit: enum labels, hard-coded labels, and configured custom labels / tags.\"\"\"\n        import litellm\n\n        builtin_labels: Final = frozenset(label.value for label in UserAPIKeyLabelNames)\n        custom_metadata_labels: Final = frozenset(\n            _sanitize_prometheus_label_name(label) for label in litellm.custom_prometheus_metadata_labels\n        )\n        custom_tag_labels: Final = frozenset(\n            _sanitize_prometheus_label_name(f\"tag_{tag}\") for tag in litellm.custom_prometheus_tags\n        )\n        return builtin_labels | _NON_ENUM_METRIC_LABELS | custom_metadata_labels | custom_tag_labels\n\n    def _validate_all_configurations(self, parsed_configs: list) -> ValidationResults:","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/prometheus.py#L720-L756","documentation":"Error \"Prometheus exclude configuration validation failed:\n{errors}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/prometheus.py:738 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the Prometheus exclude configuration errors listed in the message."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}