{"record":{"id":"dfdc12b18a21ae4e","repo":"BerriAI/litellm","slug":"invalid-metric-name-metric-name","errorCode":null,"errorMessage":"Invalid metric name: {metric_name}","messagePattern":"Invalid metric name: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/integrations/prometheus.py","lineNumber":1014,"sourceCode":"            # Fallback to simple logging if rich is not available\n            verbose_logger.error(\n                \"Invalid metric name: %s. Valid metrics: %s\", invalid_metric_name, sorted(valid_metrics)\n            )\n\n    #########################################################\n    # End of pretty print functions\n    #########################################################\n\n    def _valid_metric_name(self, metric_name: str):\n        \"\"\"\n        Raises ValueError if the metric name is invalid and pretty prints the error\n        \"\"\"\n        error: Final = self._validate_single_metric_name(metric_name)\n        if error:\n            self._pretty_print_invalid_metric_error(\n                invalid_metric_name=error.metric_name, valid_metrics=error.valid_metrics\n            )\n            raise ValueError(error.message)\n\n    def _pretty_print_prometheus_config(self, label_filters: dict[str, list[str]]) -> None:\n        \"\"\"Pretty print the processed prometheus configuration using rich\"\"\"\n        try:\n            from rich.console import Console\n            from rich.panel import Panel\n            from rich.table import Table\n            from rich.text import Text\n\n            console: Final = Console()\n\n            # Create main panel title\n            title: Final = Text(\"Prometheus Configuration Processed\", style=\"bold blue\")\n\n            # Create enabled metrics table\n            metrics_table: Final = Table(\n                title=\"📊 Enabled Metrics\",\n                show_header=True,","sourceCodeStart":996,"sourceCodeEnd":1032,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/integrations/prometheus.py#L996-L1032","documentation":"Error \"Invalid metric name: {metric_name}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/integrations/prometheus.py:1014 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a valid Prometheus metric name ([a-zA-Z_:][a-zA-Z0-9_:]*)."],"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"}