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

Function runChecker

cmd/tempo-vulture/main.go:366–399  ·  view source on GitHub ↗
(
	ticker *time.Ticker,
	config vultureConfiguration,
	selectPastTimestamp func(now time.Time) (newStart, ts time.Time, skip bool),
	checker func(*util.TraceInfo, *zap.Logger),
	l *zap.Logger,
)

Source from the content-addressed store, hash-verified

364}
365
366func runChecker(
367 ticker *time.Ticker,
368 config vultureConfiguration,
369 selectPastTimestamp func(now time.Time) (newStart, ts time.Time, skip bool),
370 checker func(*util.TraceInfo, *zap.Logger),
371 l *zap.Logger,
372) {
373 if ticker == nil {
374 return
375 }
376 go func() {
377 for now := range ticker.C {
378 startTime, seed, skip := selectPastTimestamp(now)
379 if skip {
380 continue
381 }
382
383 logger := l.With(
384 zap.String("org_id", config.tempoOrgID),
385 zap.Int64("seed", seed.Unix()),
386 )
387
388 info := util.NewTraceInfo(seed, config.tempoOrgID)
389
390 // Don't query for a trace we don't expect to be complete
391 if !traceIsReady(info, now, startTime,
392 config.tempoWriteBackoffDuration, config.tempoLongWriteBackoffDuration) {
393 continue
394 }
395
396 checker(info, logger)
397 }
398 }()
399}
400
401func doRead(httpClient httpclient.TempoHTTPClient, _ vultureConfiguration, info *util.TraceInfo, l *zap.Logger) {
402 // query the trace

Callers 5

TestRunCheckerWithSkipFunction · 0.85
TestRunCheckerSuccessFunction · 0.85
mainFunction · 0.85

Calls 4

NewTraceInfoFunction · 0.92
selectPastTimestampFunction · 0.85
traceIsReadyFunction · 0.85
StringMethod · 0.45

Tested by 4

TestRunCheckerWithSkipFunction · 0.68
TestRunCheckerSuccessFunction · 0.68