Skip to content

Improve disk buffering example to retry exporting unsuccessfully exported batches#2539

Merged
trask merged 1 commit intoopen-telemetry:mainfrom
bencehornak:disk-buffering-example
Jan 12, 2026
Merged

Improve disk buffering example to retry exporting unsuccessfully exported batches#2539
trask merged 1 commit intoopen-telemetry:mainfrom
bencehornak:disk-buffering-example

Conversation

@bencehornak
Copy link
Copy Markdown
Contributor

Description:

I have noticed some issues with the "Reading data" section of the disk buffering README.

Firstly, the CompletableResultCodes are not awaited, they are just fired and forgotten, causing leaks and potential performance problems in the embedding application.

Secondly, the errors encountered during exporting are simply ignored, and the iteration goes on causing the unsuccessfully exported batches to be deleted permanently. This means that if there is an IOException for example due to the device or the telemetry backend being offline, the telemetry is dropped silently.

In the proposed example both issues are addressed.

Existing Issue(s):

Related: open-telemetry/opentelemetry-android#1493

Testing:

N/A (only changed a README)

@bencehornak
Copy link
Copy Markdown
Contributor Author

I find the design of StorageIterator counterintuitive, because as opposed to most Iterators, its next() method has a side-effect, namely that it deletes a file from the disk. I have created a ticket for discussing this topic: #2540.

Copy link
Copy Markdown
Contributor

@LikeTheSalad LikeTheSalad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 🙏

@trask trask enabled auto-merge January 12, 2026 22:16
@trask trask added this pull request to the merge queue Jan 12, 2026
Merged via the queue into open-telemetry:main with commit 0aaea5e Jan 12, 2026
34 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants