prometheus/model
Julien Pivotto c9d4689e0b relabeling: Fix labelmap action validation with legacy metric name scheme
Fixes #17370

In Prometheus v3.7.0, using labelmap actions with replacement patterns
containing regex variables (e.g., `$1`, `${1}`) would fail validation
when `metric_name_validation_scheme` was set to `legacy`, causing
Prometheus to fail at startup with:
  "$1" is invalid 'replacement' for labelmap action

This was a regression as the same configuration worked in v3.6.0.

The issue was in the validation logic: while UTF-8 validation correctly
allowed `$` characters, legacy validation incorrectly used
`IsValidLabelName` which rejects `$` characters. The fix ensures legacy
validation uses `relabelTargetLegacy` regex which explicitly supports
regex template variables.

Added test cases to verify labelmap validation works with both `$1` and
`${1}` replacement patterns under legacy validation scheme.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2025-10-22 10:13:06 +02:00
..
exemplar update links to openmetrics to reference the v1.0.0 release 2024-12-13 21:32:27 +00:00
histogram Merge pull request #16851 from jingchanglu/main 2025-09-30 12:54:48 +01:00
labels fix(textparse/protobuf): metric family name corrupted by NHCB parser (#17156) 2025-09-08 17:26:41 +02:00
metadata Revert "feat(storage): add new CombinedAppender interface and compatibility layer" 2025-08-29 08:16:39 +01:00
relabel relabeling: Fix labelmap action validation with legacy metric name scheme 2025-10-22 10:13:06 +02:00
rulefmt Make metric/label name validation scheme explicit (#16928) 2025-08-18 08:09:00 +00:00
textparse refactor(textparse): Introduce Variadic options in textParse.New (#17155) 2025-09-11 10:49:42 +01:00
timestamp Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
value Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00