|
21 | 21 |
|
22 | 22 | type errMaxSeriesPerLabelSetLimitExceeded struct { |
23 | 23 | error |
24 | | - id string |
25 | | - localLimit int |
26 | | - globalLimit int |
| 24 | + id string |
| 25 | + actualLocalLimit int |
| 26 | + globalLimit int |
27 | 27 | } |
28 | 28 |
|
29 | 29 | // RingCount is the interface exposed by a ring implementation which allows |
@@ -130,9 +130,9 @@ func (l *Limiter) AssertMaxSeriesPerLabelSet(userID string, metric labels.Labels |
130 | 130 | return err |
131 | 131 | } else if u >= local { |
132 | 132 | return errMaxSeriesPerLabelSetLimitExceeded{ |
133 | | - id: limit.Id, |
134 | | - localLimit: local, |
135 | | - globalLimit: limit.Limits.MaxSeries, |
| 133 | + id: limit.Id, |
| 134 | + actualLocalLimit: local, |
| 135 | + globalLimit: limit.Limits.MaxSeries, |
136 | 136 | } |
137 | 137 | } |
138 | 138 | } |
@@ -208,8 +208,9 @@ func (l *Limiter) formatMaxMetadataPerMetricError(userID string, metric string) |
208 | 208 | } |
209 | 209 |
|
210 | 210 | func (l *Limiter) formatMaxSeriesPerLabelSetError(err errMaxSeriesPerLabelSetLimitExceeded) error { |
211 | | - return fmt.Errorf("per-labelset series limit of %d exceeded (labelSet: %s, local limit: %d global limit: %d actual)", |
212 | | - minNonZero(err.globalLimit, err.localLimit), err.id, err.localLimit, err.globalLimit) |
| 211 | + // per labelset limit does not have a configurable local limit like per user max series, so local limit is always zero. |
| 212 | + return fmt.Errorf("per-labelset series limit of %d exceeded (labelSet: %s, local limit: 0 global limit: %d actual local limit: %d)", |
| 213 | + minNonZero(err.globalLimit, err.actualLocalLimit), err.id, err.globalLimit, err.actualLocalLimit) |
213 | 214 | } |
214 | 215 |
|
215 | 216 | func (l *Limiter) limitsPerLabelSets(userID string, metric labels.Labels) []validation.LimitsPerLabelSet { |
|
0 commit comments