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

Function NewStore

modules/storage/store.go:39–57  ·  view source on GitHub ↗

NewStore creates a new Tempo Store using configuration supplied.

(cfg Config, cacheProvider cache.Provider, logger log.Logger)

Source from the content-addressed store, hash-verified

37
38// NewStore creates a new Tempo Store using configuration supplied.
39func NewStore(cfg Config, cacheProvider cache.Provider, logger log.Logger) (Store, error) {
40 statCache.Set(cfg.Trace.Cache)
41 statBackend.Set(cfg.Trace.Backend)
42
43 r, w, c, err := tempodb.New(&cfg.Trace, cacheProvider, logger)
44 if err != nil {
45 return nil, err
46 }
47
48 s := &store{
49 cfg: cfg,
50 Reader: r,
51 Writer: w,
52 Compactor: c,
53 }
54
55 s.Service = services.NewIdleService(s.starting, s.stopping)
56 return s, nil
57}
58
59func (s *store) starting(_ context.Context) error {
60 return nil

Callers 5

newStoreWithLoggerFunction · 0.92
newStoreWithLoggerFunction · 0.92
newStoreWithLoggerFunction · 0.92
newStoreWithLoggerFunction · 0.92
newTestStoreFunction · 0.92

Calls 2

NewFunction · 0.92
SetMethod · 0.65

Tested by 5

newStoreWithLoggerFunction · 0.74
newStoreWithLoggerFunction · 0.74
newStoreWithLoggerFunction · 0.74
newStoreWithLoggerFunction · 0.74
newTestStoreFunction · 0.74