Skip to content

Commit a36c5ba

Browse files
tbs: Clean up metric registration in storage manager (elastic#17290)
The metric registration is no longer required since storage metrics are now synchronous.
1 parent c84a2a1 commit a36c5ba

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

x-pack/apm-server/sampling/eventstorage/storage_manager.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ type StorageManager struct {
140140
// meterProvider is the OTel meter provider
141141
meterProvider metric.MeterProvider
142142
storageMetrics storageMetrics
143-
144-
metricRegistration metric.Registration
145143
}
146144

147145
type storageMetrics struct {
@@ -335,11 +333,6 @@ func (sm *StorageManager) Close() error {
335333
}
336334

337335
func (sm *StorageManager) close() error {
338-
if sm.metricRegistration != nil {
339-
if err := sm.metricRegistration.Unregister(); err != nil {
340-
sm.logger.With(logp.Error(err)).Error("failed to unregister metric")
341-
}
342-
}
343336
return errors.Join(
344337
wrapNonNilErr("event db flush error: %w", sm.eventDB.Flush()),
345338
wrapNonNilErr("decision db flush error: %w", sm.decisionDB.Flush()),

0 commit comments

Comments
 (0)