build: go 1.24

We were running behind and there were quite some deprecations to update.
This was mostly in the upstream copy/pasta package but seems quite
minimal.
This commit is contained in:
2025-03-16 12:04:32 +01:00
parent a2b678caf6
commit 1723025fbf
822 changed files with 25433 additions and 197407 deletions

View File

@ -38,7 +38,7 @@ type EncoderOption func(*encoderOption)
// WithCreatedLines is an EncoderOption that configures the OpenMetrics encoder
// to include _created lines (See
// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#counter-1).
// https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#counter-1).
// Created timestamps can improve the accuracy of series reset detection, but
// come with a bandwidth cost.
//
@ -102,7 +102,7 @@ func WithUnit() EncoderOption {
//
// - According to the OM specs, the `# UNIT` line is optional, but if populated,
// the unit has to be present in the metric name as its suffix:
// (see https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit).
// (see https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#unit).
// However, in order to accommodate any potential scenario where such a change in the
// metric name is not desirable, the users are here given the choice of either explicitly
// opt in, in case they wish for the unit to be included in the output AND in the metric name

View File

@ -65,7 +65,7 @@ func (a *Alert) Resolved() bool {
return a.ResolvedAt(time.Now())
}
// ResolvedAt returns true off the activity interval ended before
// ResolvedAt returns true iff the activity interval ended before
// the given timestamp.
func (a *Alert) ResolvedAt(ts time.Time) bool {
if a.EndsAt.IsZero() {

View File

@ -22,7 +22,7 @@ import (
)
const (
// AlertNameLabel is the name of the label containing the an alert's name.
// AlertNameLabel is the name of the label containing the alert's name.
AlertNameLabel = "alertname"
// ExportedLabelPrefix is the prefix to prepend to the label names present in

View File

@ -27,14 +27,26 @@ import (
)
var (
// NameValidationScheme determines the method of name validation to be used by
// all calls to IsValidMetricName() and LabelName IsValid(). Setting UTF-8 mode
// in isolation from other components that don't support UTF-8 may result in
// bugs or other undefined behavior. This value is intended to be set by
// UTF-8-aware binaries as part of their startup. To avoid need for locking,
// this value should be set once, ideally in an init(), before multiple
// goroutines are started.
NameValidationScheme = LegacyValidation
// NameValidationScheme determines the global default method of the name
// validation to be used by all calls to IsValidMetricName() and LabelName
// IsValid().
//
// Deprecated: This variable should not be used and might be removed in the
// far future. If you wish to stick to the legacy name validation use
// `IsValidLegacyMetricName()` and `LabelName.IsValidLegacy()` methods
// instead. This variable is here as an escape hatch for emergency cases,
// given the recent change from `LegacyValidation` to `UTF8Validation`, e.g.,
// to delay UTF-8 migrations in time or aid in debugging unforeseen results of
// the change. In such a case, a temporary assignment to `LegacyValidation`
// value in the `init()` function in your main.go or so, could be considered.
//
// Historically we opted for a global variable for feature gating different
// validation schemes in operations that were not otherwise easily adjustable
// (e.g. Labels yaml unmarshaling). That could have been a mistake, a separate
// Labels structure or package might have been a better choice. Given the
// change was made and many upgraded the common already, we live this as-is
// with this warning and learning for the future.
NameValidationScheme = UTF8Validation
// NameEscapingScheme defines the default way that names will be escaped when
// presented to systems that do not support UTF-8 names. If the Content-Type
@ -50,7 +62,7 @@ var (
type ValidationScheme int
const (
// LegacyValidation is a setting that requirets that metric and label names
// LegacyValidation is a setting that requires that all metric and label names
// conform to the original Prometheus character requirements described by
// MetricNameRE and LabelNameRE.
LegacyValidation ValidationScheme = iota