diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a50a13418..2ff6eaa2cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#5534](https://github.com/thanos-io/thanos/pull/5534) Query: Set struct return by query api alerts same as prometheus api. - [#5554](https://github.com/thanos-io/thanos/pull/5554) Query/Receiver: Fix querying exemplars from multi-tenant receivers. - [#5583](https://github.com/thanos-io/thanos/pull/5583) Query: fix data race between Respond() and query/queryRange functions. Fixes [#5410](https://github.com/thanos-io/thanos/pull/5410). +- [#5642](https://github.com/thanos-io/thanos/pull/5642) Receive: Log labels correctly in writer debug messages. ### Added diff --git a/pkg/receive/writer.go b/pkg/receive/writer.go index aa02f7e08b..31b735710f 100644 --- a/pkg/receive/writer.go +++ b/pkg/receive/writer.go @@ -78,16 +78,17 @@ func (r *Writer) Write(ctx context.Context, tenantID string, wreq *prompb.WriteR // Check if time series labels are valid. If not, skip the time series // and report the error. if err := labelpb.ValidateLabels(t.Labels); err != nil { + lset := &labelpb.ZLabelSet{Labels: t.Labels} switch err { case labelpb.ErrOutOfOrderLabels: numLabelsOutOfOrder++ - level.Debug(tLogger).Log("msg", "Out of order labels in the label set", "lset", t.Labels) + level.Debug(tLogger).Log("msg", "Out of order labels in the label set", "lset", lset.String()) case labelpb.ErrDuplicateLabels: numLabelsDuplicates++ - level.Debug(tLogger).Log("msg", "Duplicate labels in the label set", "lset", t.Labels) + level.Debug(tLogger).Log("msg", "Duplicate labels in the label set", "lset", lset.String()) case labelpb.ErrEmptyLabels: numLabelsEmpty++ - level.Debug(tLogger).Log("msg", "Labels with empty name in the label set", "lset", t.Labels) + level.Debug(tLogger).Log("msg", "Labels with empty name in the label set", "lset", lset.String()) default: level.Debug(tLogger).Log("msg", "Error validating labels", "err", err) }