jaegertracing/jaeger · error
failed to search for throughputs: %w
Error message
failed to search for throughputs: %w
What it means
GetThroughput in the Elasticsearch sampling store executes a search over the rotated throughput indices using buildTSQuery; if the ES search call itself fails (connection error, HTTP error, invalid query), the error is wrapped with 'failed to search for throughputs' before being returned to the remote sampling client.
Source
Thrown at internal/storage/v1/elasticsearch/samplingstore/storage.go:93
Timestamp: ts,
Throughput: eachThroughput,
},
})
}
// context.Background: sampling writes are not request-scoped, and the async
// indexer this uses ignores the context anyway (see BulkIndexer.WriteBatch).
return s.batchWriter.WriteBatch(context.Background(), items)
}
func (s *SamplingStore) GetThroughput(start, end time.Time) ([]*model.Throughput, error) {
ctx := context.Background()
readIndices := s.rotation.ReadTargets(start, end)
searchResult, err := s.searcher.Search(ctx, readIndices, esclient.SearchRequest{
Size: s.maxDocCount,
Query: buildTSQuery(start, end),
})
if err != nil {
return nil, fmt.Errorf("failed to search for throughputs: %w", err)
}
output := make([]dbmodel.TimeThroughput, len(searchResult.Hits.Hits))
for i, hit := range searchResult.Hits.Hits {
if err := json.Unmarshal(hit.Source, &output[i]); err != nil {
return nil, fmt.Errorf("unmarshalling documents failed: %w", err)
}
}
outThroughputs := make([]dbmodel.Throughput, len(output))
for i, out := range output {
outThroughputs[i] = out.Throughput
}
return dbmodel.ToThroughputs(outThroughputs), nil
}
func (s *SamplingStore) InsertProbabilitiesAndQPS(hostname string,
probabilities model.ServiceOperationProbabilities,
qps model.ServiceOperationQPS,
) error {View on GitHub (pinned to 806f444784)
Solutions
- Check connectivity/credentials to Elasticsearch (URLs, auth, TLS) used by the Jaeger ES storage config.
- Verify throughput indices exist for the requested time window (rotation settings match start/end).
- Look at the wrapped ES error / ES server logs for the rejection reason (query parse, shard failures).
- Retry once ES is healthy; transient 503s during rolling restarts surface here.
Defensive patterns
Strategy: retry
Try / catch
tp, err := store.GetThroughput(ctx, start, end)
if err != nil {
if strings.Contains(err.Error(), "failed to search for throughputs") {
// ES search failed: check wrapped cause; retry after cluster recovers
}
return err
} Prevention
- Verify ES connectivity and auth before enabling remote sampling.
- Ensure sampling throughput indices/aliases exist for the query window.
- Match index rotation settings with the requested start/end times.
- Alert on ES cluster health to catch 503 windows early.
When it happens
Trigger: Calling GetThroughput when the Elasticsearch search request fails: ES unreachable, authentication rejected, index missing/aliases wrong, or the SearchRequest rejected by the cluster (e.g. query parse error).
Common situations: ES cluster down or misconfigured (server URLs, credentials); sampling data indices never created because the sampling data stream was never enabled; index rotation misalignment with the requested [start,end] window.
Related errors
- failed to search for Latest Probabilities: %w
- failed to find latest index
- failed to resolve backend version: %w
- failed to delete indices: %w
- failed to create index: %w
AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01).
Data as JSON: /api/errors/367ea66b36175ed6.
Report an issue: GitHub.