Skip to content

Commit

Permalink
Add metric name to metadata error (cortexproject#4363)
Browse files Browse the repository at this point in the history
Signed-off-by: Goutham Veeramachaneni <[email protected]>
Signed-off-by: Alvin Lin <[email protected]>
  • Loading branch information
gouthamve authored and alvinlin123 committed Jan 14, 2022
1 parent f1f3642 commit ff72ed6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ingester/user_metrics_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"sync"
"time"

"github.com/prometheus/prometheus/pkg/labels"

"github.com/cortexproject/cortex/pkg/cortexpb"
"github.com/cortexproject/cortex/pkg/util/validation"
)
Expand Down Expand Up @@ -49,7 +51,7 @@ func (mm *userMetricsMetadata) add(metric string, metadata *cortexpb.MetricMetad

if err := mm.limiter.AssertMaxMetadataPerMetric(mm.userID, len(set)); err != nil {
validation.DiscardedMetadata.WithLabelValues(mm.userID, perMetricMetadataLimit).Inc()
return makeLimitError(perMetricMetadataLimit, mm.limiter.FormatError(mm.userID, err))
return makeMetricLimitError(perMetricMetadataLimit, labels.FromStrings(labels.MetricName, metric), mm.limiter.FormatError(mm.userID, err))
}

// if we have seen this metadata before, it is a no-op and we don't need to change our metrics.
Expand Down

0 comments on commit ff72ed6

Please sign in to comment.