diff --git a/x-pack/apm-server/sampling/eventstorage/storage.go b/x-pack/apm-server/sampling/eventstorage/storage.go index 95ee65503ea..b848648040e 100644 --- a/x-pack/apm-server/sampling/eventstorage/storage.go +++ b/x-pack/apm-server/sampling/eventstorage/storage.go @@ -36,7 +36,8 @@ var ( // Storage provides storage for sampled transactions and spans, // and for recording trace sampling decisions. type Storage struct { - db *badger.DB + db *badger.DB + // pendingSize tracks the total size of pending writes across ReadWriters pendingSize *atomic.Int64 codec Codec } @@ -96,6 +97,7 @@ type ReadWriter struct { // be unmodified until the end of a transaction. readKeyBuf []byte pendingWrites int + // pendingSize tracks the size of pending writes in the current ReadWriter pendingSize int64 }