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

Method generatorRingReader

cmd/tempo/app/modules.go:323–347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

321}
322
323func (t *App) generatorRingReader() (ring.PartitionRingReader, error) {
324 if IsSingleBinary(t.cfg.Target) {
325 return nil, nil
326 }
327
328 switch t.cfg.Generator.RingMode {
329 case generator.RingModePartition:
330 if t.partitionRing == nil {
331 return nil, errors.New("metrics-generator ring mode is partition but partition ring is not initialized")
332 }
333 return t.partitionRing, nil
334 case generator.RingModeGenerator:
335 if t.generatorRingWatcher == nil {
336 return nil, errors.New("metrics-generator ring mode is generator but generator ring watcher is not initialized")
337 }
338 return t.generatorRingWatcher, nil
339 default:
340 return nil, fmt.Errorf(
341 "invalid metrics-generator ring mode %q, must be one of: %q, %q",
342 t.cfg.Generator.RingMode,
343 generator.RingModePartition,
344 generator.RingModeGenerator,
345 )
346 }
347}
348
349func (t *App) initGeneratorNoLocalBlocks() (services.Service, error) {
350 t.cfg.Generator.RingMode = generator.RingModeGenerator

Callers 2

initGeneratorMethod · 0.95
TestGeneratorRingReaderFunction · 0.95

Calls 1

IsSingleBinaryFunction · 0.85

Tested by 1

TestGeneratorRingReaderFunction · 0.76