Skip to content

Commit 5c34efb

Browse files
committed
Update parser in metrics integration tests
1 parent 51f469e commit 5c34efb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/integration/utils/mock_collector_utils.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717

1818
dto "github.com/prometheus/client_model/go"
1919
"github.com/prometheus/common/expfmt"
20+
"github.com/prometheus/common/model"
2021

2122
"github.com/go-resty/resty/v2"
2223
"github.com/testcontainers/testcontainers-go"
@@ -108,7 +109,7 @@ func ScrapeCollectorMetricFamilies(t *testing.T, ctx context.Context,
108109
t.Fatalf("Unexpected status code: %d", resp.StatusCode())
109110
}
110111

111-
parser := expfmt.TextParser{}
112+
parser := expfmt.NewTextParser(model.UTF8Validation)
112113
metricFamilies, err := parser.TextToMetricFamilies(bytes.NewReader(resp.Body()))
113114
if err != nil {
114115
t.Fatalf("failed to parse metrics: %v", err)

0 commit comments

Comments
 (0)