Commit be2e76c
committed
fix(metrics): ensure consistent label cardinality for eval CounterVec
The metrics code registers a CounterVec with label names from the first
LMEvalJob it sees. If a subsequent job has a different set of modelArgs
(e.g. one has base_url and another doesn't), the label count mismatches
and Prometheus panics with "inconsistent label cardinality".
Fix by always initializing both model_name and base_url labels to empty
strings before populating from modelArgs, ensuring every job produces
the same 6-label set.
This is a pre-existing bug on main that was not surfaced because there
was only one LMES test case. The new CA bundle tests in this PR create
jobs with varying modelArgs, exposing the panic.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rh-pre-commit.version: 2.3.2
rh-pre-commit.check-secrets: ENABLED1 parent 5c843c1 commit be2e76c
1 file changed
Lines changed: 4 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | | - | |
484 | | - | |
485 | | - | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
486 | 487 | | |
487 | 488 | | |
488 | 489 | | |
489 | | - | |
490 | 490 | | |
491 | 491 | | |
492 | 492 | | |
493 | | - | |
494 | | - | |
495 | | - | |
496 | | - | |
497 | 493 | | |
498 | 494 | | |
499 | 495 | | |
| |||
0 commit comments