mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -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) {
|
func (app *limitAppender) Add(lset labels.Labels, t int64, v float64) (string, error) {
|
||||||
if app.i+1 > app.limit {
|
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)
|
ref, err := app.Appender.Add(lset, t, v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", fmt.Errorf("sample limit of %d exceeded", app.limit)
|
return "", err
|
||||||
}
|
}
|
||||||
app.i++
|
app.i++
|
||||||
return ref, nil
|
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 {
|
func (app *limitAppender) AddFast(ref string, t int64, v float64) error {
|
||||||
if app.i+1 > app.limit {
|
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 {
|
if err := app.Appender.AddFast(ref, t, v); err != nil {
|
||||||
return fmt.Errorf("sample limit of %d exceeded", app.limit)
|
return err
|
||||||
}
|
}
|
||||||
app.i++
|
app.i++
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue