Make sure buffer files are cleared at startup #159701

Open
mamazzol opened 10:28am on September 18, 2026 wants to merge 35 Ξ” into elastic/elasticsearch main from
otel-buffer-metrics
Reviewing
3 fewer changed lines
(9% less) vs GitHub
This saves about 15.8 hours per year vs conventional diff tools
mamazzol authored
of work during September 18
Diff Delta:
35
About 5 Diff Delta/hour
Classified as:  Bug Fix, General

mamazzol's Description of Work

This PR fixes a telemetry bug for the buffer.
If there are files at startup from previous buffering, they will now be accounted for and registered in cachedFileCount so on a successful export, the cachedFileCount > 0 condition is true.
Until now, a failed export would be required to finally clear those pre-existing files.

4 total changed files
Loading changes...
Loading changes...
You’ve completed the full review pass
Like the credits, but with fewer stunts.