MCPcopy
hub / github.com/grafana/tempo / forLiveStoreRing

Method forLiveStoreRing

modules/querier/querier.go:316–334  ·  view source on GitHub ↗

forLiveStoreRing runs f, in parallel, for instances selected from the live-store ring.

(ctx context.Context, f forEachFn)

Source from the content-addressed store, hash-verified

314
315// forLiveStoreRing runs f, in parallel, for instances selected from the live-store ring.
316func (q *Querier) forLiveStoreRing(ctx context.Context, f forEachFn) ([]any, error) {
317 if ctx.Err() != nil {
318 _ = level.Debug(log.Logger).Log("forLiveStoreRing context error", "ctx.Err()", ctx.Err().Error())
319 return nil, ctx.Err()
320 }
321
322 ctx, span := tracer.Start(ctx, "Querier.forLiveStoreRing")
323 defer span.End()
324
325 if q.partitionRing == nil {
326 return nil, errors.New("forLiveStoreRing: partition ring is not configured")
327 }
328
329 rs, err := q.partitionRing.GetReplicationSetsForOperation(ring.Read)
330 if err != nil {
331 return nil, fmt.Errorf("error finding partition ring replicas: %w", err)
332 }
333 return forPartitionRingReplicaSets(ctx, q, rs, f)
334}
335
336// forLiveStoreMetricsRing runs f, in parallel, for instances selected from the live-store ring.
337func (q *Querier) forLiveStoreMetricsRing(ctx context.Context, f forEachMetricsFn) ([]any, error) {

Callers 6

FindTraceByIDMethod · 0.95
SearchRecentMethod · 0.95
SearchTagsMethod · 0.95
SearchTagsV2Method · 0.95
SearchTagValuesMethod · 0.95
SearchTagValuesV2Method · 0.95

Calls 4

LogMethod · 0.65
ErrorMethod · 0.65
StartMethod · 0.65

Tested by

no test coverage detected