OPS-03: dev-server fuer live-scrape-verifikation; expfmt-namensvalidierung fixen

This commit is contained in:
sysops
2026-08-28 08:43:18 +02:00
parent 814a7fda0a
commit da80643564
3 changed files with 56 additions and 2 deletions
+2 -1
View File
@@ -11,6 +11,7 @@ import (
"time"
"github.com/prometheus/common/expfmt"
"github.com/prometheus/common/model"
)
func fakeModuleServer(metricName string) *httptest.Server {
@@ -33,7 +34,7 @@ func TestHandler_ServesCoreMetricsInPrometheusFormat(t *testing.T) {
t.Fatalf("status = %d, want 200", rec.Code)
}
var parser expfmt.TextParser
parser := expfmt.NewTextParser(model.LegacyValidation)
families, err := parser.TextToMetricFamilies(strings.NewReader(rec.Body.String()))
if err != nil {
t.Fatalf("antwort ist kein valides prometheus-textformat: %v", err)