From: Daniel Swarbrick <dswarbrick@debian.org>
Date: Wed, 31 Dec 2025 19:40:06 +0100
Subject: Support prometheus/common v0.66.0

Forwarded: not-needed
---
 cmd/promtool/main.go   | 2 +-
 util/fmtutil/format.go | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/promtool/main.go b/cmd/promtool/main.go
index c5a9e32..837cf68 100644
--- a/cmd/promtool/main.go
+++ b/cmd/promtool/main.go
@@ -973,7 +973,7 @@ type metricStat struct {
 }
 
 func checkMetricsExtended(r io.Reader) ([]metricStat, int, error) {
-	p := expfmt.TextParser{}
+	p := expfmt.NewTextParser(model.LegacyValidation)
 	metricFamilies, err := p.TextToMetricFamilies(r)
 	if err != nil {
 		return nil, 0, fmt.Errorf("error while parsing text to metric families: %w", err)
diff --git a/util/fmtutil/format.go b/util/fmtutil/format.go
index 9034a90..e354ecb 100644
--- a/util/fmtutil/format.go
+++ b/util/fmtutil/format.go
@@ -46,7 +46,7 @@ var MetricMetadataTypeValue = map[string]int32{
 
 // MetricTextToWriteRequest consumes an io.Reader and return the data in write request format.
 func MetricTextToWriteRequest(input io.Reader, labels map[string]string) (*prompb.WriteRequest, error) {
-	var parser expfmt.TextParser
+	parser := expfmt.NewTextParser(model.LegacyValidation)
 	mf, err := parser.TextToMetricFamilies(input)
 	if err != nil {
 		return nil, err
