thanos-io/thanos · error
failed to send samples
Error message
failed to send samples
What it means
limiterStore's Send wraps the samplesLimiter.Reserve error with "failed to send samples"; the estimated sample count is chunksCount * MaxSamplesPerChunk and exceeding the configured chunk/sample limit aborts the response. This protects downstream queriers from huge chunk loads.
Solutions
- Shorten the query time range or lower data resolution/downsampling usage.
- Increase --store.chunk-limit on store-gateway/query.
- Split the query into smaller ranges (query sharding / time partitioning).
- Verify downsampling is enabled so long ranges use downsampled blocks.
Example fix
// before query_range:start=now-30d, step=15s // after query_range:start=now-7d, step=60s # or rely on 5m downsampled blocks
Defensive patterns
Strategy: validation
Validate before calling
// estimate samples: chunks ≈ range/step; ensure under limit
if uint64(estimatedChunks)*MaxSamplesPerChunk > samplesLimit { /* reduce range or raise limit */ } Try / catch
if err != nil && strings.Contains(err.Error(), "failed to send samples") {
// retry with shorter time range or coarser step
} Prevention
- Enable downsampling so long ranges use 5m/1h blocks
- Keep step sizes coarse for long query ranges
- Tune chunk-limit from measured per-query chunk counts
When it happens
Trigger: Streaming a Series response whose chunks, converted to estimated samples (chunks * MaxSamplesPerChunk), exceed the samples/chunks limiter limit.
Common situations: Long time ranges with high-resolution data in one query; --store.chunk-limit set too low; queries hitting many blocks at once.
Related errors
- iterate chunk while re-encoding
- populateWithDelChunkSeriesIterator: unexpected empty chunk…
- limit violated (got )
- failed to send series
- failed to parse template
AI-assisted analysis of thanos-io/thanos@35b8b99117 (2026-09-07).
Data as JSON: /api/errors/8806c50528a881dd.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/store/limiter.go:190
seriesCount = 1
chunksCount = uint64(len(series.Chunks))
} else if batch := response.GetBatch(); batch != nil {
for _, series := range batch.Series {
if series == nil {
continue
}
seriesCount++
chunksCount += uint64(len(series.Chunks))
}
} else {
return i.Store_SeriesServer.Send(response)
}
if err := i.seriesLimiter.Reserve(seriesCount); err != nil {
return errors.Wrapf(err, "failed to send series")
}
if err := i.samplesLimiter.Reserve(chunksCount * MaxSamplesPerChunk); err != nil {
return errors.Wrapf(err, "failed to send samples")
}
return i.Store_SeriesServer.Send(response)
}
View on GitHub (pinned to 35b8b99117)