mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
Pass through storage errors in limitAppender.
This commit is contained in:
parent
ab0ce4a8d9
commit
72a276e7ed
|
@ -238,11 +238,11 @@ type limitAppender struct {
|
|||
|
||||
func (app *limitAppender) Add(lset labels.Labels, t int64, v float64) (string, error) {
|
||||
if app.i+1 > app.limit {
|
||||
return "", errors.New("sample limit exceeded")
|
||||
return "", fmt.Errorf("sample limit of %d exceeded", app.limit)
|
||||
}
|
||||
ref, err := app.Appender.Add(lset, t, v)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("sample limit of %d exceeded", app.limit)
|
||||
return "", err
|
||||
}
|
||||
app.i++
|
||||
return ref, nil
|
||||
|
@ -250,11 +250,11 @@ func (app *limitAppender) Add(lset labels.Labels, t int64, v float64) (string, e
|
|||
|
||||
func (app *limitAppender) AddFast(ref string, t int64, v float64) error {
|
||||
if app.i+1 > app.limit {
|
||||
return errors.New("sample limit exceeded")
|
||||
return fmt.Errorf("sample limit of %d exceeded", app.limit)
|
||||
}
|
||||
|
||||
if err := app.Appender.AddFast(ref, t, v); err != nil {
|
||||
return fmt.Errorf("sample limit of %d exceeded", app.limit)
|
||||
return err
|
||||
}
|
||||
app.i++
|
||||
return nil
|
||||
|
|
Loading…
Reference in a new issue