Skip to content

Commit 8317f7e

Browse files
fix(deps): update module github.com/prometheus/client_golang to v1.23.2 (main) (#19763)
Signed-off-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: renovate-sh-app[bot] <219655108+renovate-sh-app[bot]@users.noreply.github.com> Co-authored-by: Paul Rogers <paul.rogers@grafana.com>
1 parent ceb7c84 commit 8317f7e

58 files changed

Lines changed: 10367 additions & 182 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎clients/cmd/docker-driver/config.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func parseConfig(logCtx logger.Info) (*config, error) {
222222
return nil, fmt.Errorf("%s: invalid external labels: %s", driverName, extlbs)
223223
}
224224
labelName := model.LabelName(lvparts[0])
225-
if !labelName.IsValid() {
225+
if !model.UTF8Validation.IsValidLabelName(string(labelName)) {
226226
return nil, fmt.Errorf("%s: invalid external label name: %s", driverName, labelName)
227227
}
228228

@@ -268,7 +268,7 @@ func parseConfig(logCtx logger.Info) (*config, error) {
268268

269269
for key, value := range attrs {
270270
labelName := model.LabelName(key)
271-
if !labelName.IsValid() {
271+
if !model.UTF8Validation.IsValidLabelName(string(labelName)) {
272272
return nil, fmt.Errorf("%s: invalid label name from attribute: %s", driverName, key)
273273
}
274274
labelValue := model.LabelValue(value)

‎clients/cmd/fluent-bit/loki.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func extractLabels(records map[string]interface{}, keys []string) model.LabelSet
164164
}
165165
ln := model.LabelName(k)
166166
// skips invalid name and values
167-
if !ln.IsValidLegacy() {
167+
if !model.LegacyValidation.IsValidLabelName(string(ln)) {
168168
continue
169169
}
170170
lv := model.LabelValue(fmt.Sprintf("%v", v))
@@ -191,7 +191,7 @@ func mapLabels(records map[string]interface{}, mapping map[string]interface{}, r
191191
if value, ok := getRecordValue(k, records); ok {
192192
lName := model.LabelName(nextKey)
193193
lValue := model.LabelValue(value)
194-
if lValue.IsValid() && lName.IsValid() {
194+
if lValue.IsValid() && model.UTF8Validation.IsValidLabelName(string(lName)) {
195195
res[lName] = lValue
196196
}
197197
}

‎clients/pkg/logentry/metric/metricvec.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func cleanLabels(set model.LabelSet) model.LabelSet {
6565
for k, v := range set {
6666
// Performing the same label validity check the prometheus go client library does.
6767
// https://github.com/prometheus/client_golang/blob/618194de6ad3db637313666104533639011b470d/prometheus/labels.go#L85
68-
if !k.IsValid() || strings.HasPrefix(string(k), "__") {
68+
if !model.UTF8Validation.IsValidLabelName(string(k)) || strings.HasPrefix(string(k), "__") {
6969
continue
7070
}
7171
out[k] = v

‎clients/pkg/logentry/stages/eventlogmessage.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func validateEventLogMessageConfig(c *EventLogMessageConfig) error {
6060
if c == nil {
6161
return errors.New(ErrEmptyEvtLogMsgStageConfig)
6262
}
63-
if c.Source != nil && !model.LabelName(*c.Source).IsValidLegacy() {
63+
if c.Source != nil && !model.LegacyValidation.IsValidLabelName(*c.Source) {
6464
return fmt.Errorf(ErrInvalidLabelName, *c.Source)
6565
}
6666
return nil
@@ -108,7 +108,7 @@ func (m *eventLogMessageStage) processEntry(extracted map[string]interface{}, ke
108108
continue
109109
}
110110
mkey := parts[0]
111-
if !model.LabelName(mkey).IsValidLegacy() {
111+
if !model.LegacyValidation.IsValidLabelName(mkey) {
112112
if m.cfg.DropInvalidLabels {
113113
if Debug {
114114
level.Debug(m.logger).Log("msg", "invalid label parsed from message", "key", mkey)

‎clients/pkg/logentry/stages/labels.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func validateLabelsConfig(c LabelsConfig) error {
2626
return errors.New(ErrEmptyLabelStageConfig)
2727
}
2828
for labelName, labelSrc := range c {
29-
if !model.LabelName(labelName).IsValidLegacy() {
29+
if !model.LegacyValidation.IsValidLabelName(labelName) {
3030
return fmt.Errorf(ErrInvalidLabelName, labelName)
3131
}
3232
// If no label source was specified, use the key name

‎clients/pkg/logentry/stages/static_labels.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func validateLabelStaticConfig(c StaticLabelConfig) error {
2525
return errors.New(ErrEmptyStaticLabelStageConfig)
2626
}
2727
for labelName := range c {
28-
if !model.LabelName(labelName).IsValid() {
28+
if !model.UTF8Validation.IsValidLabelName(labelName) {
2929
return fmt.Errorf(ErrInvalidLabelName, labelName)
3030
}
3131
}

‎clients/pkg/promtail/targets/azureeventhubs/parser.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (e *messageParser) getLabels(logRecord *azureMonitorResourceLog, relabelCon
217217
return // (will continue Range loop, not abort)
218218
}
219219
// ignore invalid labels
220-
if !model.LabelName(lbl.Name).IsValid() || !model.LabelValue(lbl.Value).IsValid() {
220+
if !model.UTF8Validation.IsValidLabelName(lbl.Name) || !model.LabelValue(lbl.Value).IsValid() {
221221
return // (will continue Range loop, not abort)
222222
}
223223
resultLabels[model.LabelName(lbl.Name)] = model.LabelValue(lbl.Value)

‎clients/pkg/promtail/targets/gcplog/formatter.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func parseGCPLogsEntry(data []byte, other model.LabelSet, otherInternal labels.L
8787
return // (will continue Range loop, not abort)
8888
}
8989
// ignore invalid labels
90-
if !model.LabelName(lbl.Name).IsValid() || !model.LabelValue(lbl.Value).IsValid() {
90+
if !model.UTF8Validation.IsValidLabelName(lbl.Name) || !model.LabelValue(lbl.Value).IsValid() {
9191
return // (will continue Range loop, not abort)
9292
}
9393
final[model.LabelName(lbl.Name)] = model.LabelValue(lbl.Value)

‎clients/pkg/promtail/targets/gcplog/push_target.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (h *pushTarget) run() error {
6868
// To prevent metric collisions because all metrics are going to be registered in the global Prometheus registry.
6969

7070
tentativeServerMetricNamespace := "promtail_gcp_push_target_" + h.jobName
71-
if !model.IsValidMetricName(model.LabelValue(tentativeServerMetricNamespace)) {
71+
if !model.UTF8Validation.IsValidMetricName(tentativeServerMetricNamespace) {
7272
return fmt.Errorf("invalid prometheus-compatible job name: %s", h.jobName)
7373
}
7474
h.config.Server.MetricsNamespace = tentativeServerMetricNamespace

‎clients/pkg/promtail/targets/heroku/target.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (h *Target) run() error {
6868
// To prevent metric collisions because all metrics are going to be registered in the global Prometheus registry.
6969

7070
tentativeServerMetricNamespace := "promtail_heroku_drain_target_" + h.jobName
71-
if !model.LabelName(tentativeServerMetricNamespace).IsValidLegacy() {
71+
if !model.LegacyValidation.IsValidLabelName(tentativeServerMetricNamespace) {
7272
return fmt.Errorf("invalid prometheus-compatible job name: %s", h.jobName)
7373
}
7474
h.config.Server.MetricsNamespace = tentativeServerMetricNamespace

0 commit comments

Comments
 (0)