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

Method isLagged

modules/livestore/live_store.go:907–916  ·  modules/livestore/live_store.go::LiveStore.isLagged
(endNanos int64)

Source from the content-addressed store, hash-verified

905var errLagged = errors.New("cannot guarantee complete results")
906
907func (s *LiveStore) isLagged(endNanos int64) bool {
908 if !s.cfg.ConsumeFromKafka { // if config disabled or no kafka consumption, never lagged
909 return false
910 }
911 lag := s.calculateTimeLag(0)
912 if lag == nil { // lag is unknown
913 return true // prefer error over potentially incomplete results
914 }
915 return time.Since(time.Unix(0, endNanos)) < *lag
916}
917
918// withInstance extracts the tenant ID from the context, gets the instance,
919// and calls the provided function if the instance exists. If the instance

Callers 3

SearchRecentMethod · 0.95
QueryRangeMethod · 0.95
TestIsLaggedFunction · 0.80

Calls 1

calculateTimeLagMethod · 0.95

Tested by 1

TestIsLaggedFunction · 0.64