Crashlytics disable otel auto flush - #10379
bryanatkinson wants to merge 4 commits into
Conversation
…rs and flush already in helpers.ts
|
There was a problem hiding this comment.
Code Review
This pull request configures the BatchLogRecordProcessor with disableAutoFlushOnDocumentHide: true in logger-provider.ts and adds corresponding unit tests. The review feedback suggests refactoring the tests to avoid fragile deep imports and global mocking of third-party internals. Instead, it is recommended to import @opentelemetry/sdk-logs as a namespace and spy on BatchLogRecordProcessor to verify that the configuration options are passed correctly.
20704a6 to
d7a09b1
Compare
We already register listeners and flush in helpers.ts. Without this setting, the BatchLogRecordProcessor also registers listeners and flushes the logs, but if that flush fails it enqueues an error log to be exported again: https://github.com/open-telemetry/opentelemetry-js/blob/3d1d427a445d6d1b76b94785c3d0f4048e38cc69/experimental/packages/sdk-logs/src/platform/browser/export/BatchLogRecordProcessor.ts#L40-L47