go.mod,tsnet,tstest/natlab/vmtest: bump prometheus/common to v0.69.0
prometheus/common v0.66/v0.67 introduced a mandatory model.ValidationScheme on expfmt.TextParser as part of prepping for UTF-8 metric/label names in Prometheus 3.0. The zero value is intentionally UnsetValidation, which panics on the first call to IsValidMetricName / IsValidLabelName with Invalid name validation scheme requested: unset so the long-standing "var parser expfmt.TextParser" pattern crashes at runtime. Several big downstreams have hit the same sharp edge: https://github.com/thanos-io/thanos/issues/8823 https://github.com/grafana/loki/pull/21401 Switch our two callers (parseMetrics in tsnet's TestUserMetricsByteCounters and the client-metrics scraper in tstest/natlab/vmtest) to the new expfmt.NewTextParser constructor with model.LegacyValidation. LegacyValidation matches the classic ASCII metric/label naming rules that tailscaled's exporter uses today; if and when we ever emit a metric with a UTF-8 name, we can revisit. Goes to v0.69.0 (the latest at the time of writing) rather than v0.67.5 so we pick up the unrelated security fixes for cross-host redirects. Done in advance so a follow-up change can pull in github.com/tailscale/policybottest (which depends on palantir/policy-bot, which transitively requires prometheus/common at v0.67+) without dragging this debugging into that PR. Updates tailscale/corp#13972 Change-Id: I4b37db9ad3bebef1a32d9020bf6f8790bab25336 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
b64209b248
commit
97e7ea8b0b
@@ -41,6 +41,7 @@ import (
|
||||
"github.com/google/gopacket/layers"
|
||||
dto "github.com/prometheus/client_model/go"
|
||||
"github.com/prometheus/common/expfmt"
|
||||
"github.com/prometheus/common/model"
|
||||
"go4.org/mem"
|
||||
"golang.org/x/sync/errgroup"
|
||||
"tailscale.com/client/local"
|
||||
@@ -909,7 +910,11 @@ func (e *Env) ClientMetrics(n *Node) ClientMetrics {
|
||||
}
|
||||
|
||||
// Metrics are reported in Prometheus exposition format.
|
||||
var parser expfmt.TextParser
|
||||
// prometheus/common v0.67 made the validation scheme mandatory;
|
||||
// the zero-value parser now panics. LegacyValidation matches the
|
||||
// classic ASCII metric/label name rules that the tailscaled
|
||||
// client exporter uses.
|
||||
parser := expfmt.NewTextParser(model.LegacyValidation)
|
||||
mfs, err := parser.TextToMetricFamilies(bytes.NewReader(raw))
|
||||
if err != nil {
|
||||
e.t.Fatalf("Node %q parse client metrics: %v", n.Name(), err)
|
||||
|
||||
Reference in New Issue
Block a user