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

Struct instance

modules/livestore/instance.go:105–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103)
104
105type instance struct {
106 tenantID string
107 logger log.Logger
108
109 // Configuration
110 Cfg Config
111
112 // WAL and encoding
113 wal *wal.WAL
114 completeBlockEncoding encoding.VersionedEncoding
115 completeBlockLifecycle completeBlockLifecycle
116
117 // blocksMtx serializes writers. Readers iterate the immutable snapshot
118 // via atomic.Load; for the headBlock's mutating BlockMeta they must use
119 // WALBlock.MetaSnapshot.
120 blocksMtx sync.Mutex
121 blocks atomic.Pointer[blockSnapshot]
122 lastCutTime time.Time
123
124 // reclaim holds blocks removed from the snapshot whose files must
125 // outlive in-flight readers; drained after the grace window.
126 reclaim *quarantine
127
128 // Live traces
129 liveTracesMtx sync.Mutex
130 liveTraces *livetraces.LiveTraces[*v1.ResourceSpans]
131 traceSizes *tracesizes.Tracker
132 maxTraceLogger *util_log.RateLimitedLogger
133 liveTracesIterNext func() (*livetraces.LiveTrace[*v1.ResourceSpans], bool)
134 liveTracesIterStop func()
135
136 // Metrics
137 tracesCreatedTotal prometheus.Counter
138 bytesReceivedTotal *prometheus.CounterVec
139
140 overrides overrides.Interface
141}
142
143func newInstance(instanceID string, cfg Config, wal *wal.WAL, completeBlockEncoding encoding.VersionedEncoding, completeBlockLifecycle completeBlockLifecycle, overrides overrides.Interface, logger log.Logger) (*instance, error) {
144 logger = log.With(logger, "tenant", instanceID)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected