Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default implementation for empty BatchProcessor #5239

Merged
merged 3 commits into from Apr 22, 2024

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Apr 19, 2024

Ensure an empty BatchProcessor does not panic when any method is called. The empty BatchProcessor is treated as a shut down BatchProcessor.

Implementing a BatchProcessor as shut down instead of initializing with defaults and environment variables is done here to simplify the implementation (there will be a race condition that needs resolution between OnEmit and Shutdown) and for performance of OnEmit. We want to ensure the highest performance of OnEmit in the standard use case as best we can. Having to check for initialization when this is called will reduce that performance.

Part of #5063

@MrAlias MrAlias added pkg:SDK Related to an SDK package area:logs Part of OpenTelemetry logs labels Apr 19, 2024
@MrAlias MrAlias added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Apr 19, 2024
Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.5%. Comparing base (9370c5a) to head (2e6e62c).

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #5239   +/-   ##
=====================================
  Coverage   85.5%   85.5%           
=====================================
  Files        258     258           
  Lines      17031   17031           
=====================================
  Hits       14571   14571           
  Misses      2152    2152           
  Partials     308     308           
Files Coverage Δ
sdk/log/batch.go 99.4% <100.0%> (ø)

... and 2 files with indirect coverage changes

Ensure an empty BatchProcessor does not panic when any method is called.
Default an empty BatchProcessor as being shut down.

Part of open-telemetry#5063
@pellared pellared merged commit b34cfc4 into open-telemetry:main Apr 22, 2024
26 checks passed
@MrAlias MrAlias deleted the blp-dflt-empty branch April 22, 2024 14:26
@MrAlias MrAlias added this to the v1.26.0 milestone Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logs Part of OpenTelemetry logs pkg:SDK Related to an SDK package Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants