opentelemetry-collector
opentelemetry-collector copied to clipboard
Offer a way to deal with status report with sharedcomponent.Map
Description: Given that we start and stop components of a shared component map once, but want to have idempotence, this PR changes the way it handles telemetry status report by removing explicit handling of report status entirely.
Rather, we rely on errors returned by Start and Shutdown.
For Start, we cache the error and return it on any subsequent runs.
For Shutdown, we only run the underlying Shutdown on the last call and return the error if any. Any previous calls return nil.
This change in approach allows to be closer to the lifecycle of a normal component and doesn't have the overhead of dealing with status reporting, which is handled like every other component by the service.
Link to tracking Issue: Fixes #9155
Testing: Unit tests
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 90.37%. Comparing base (
9553bfe) to head (ef54ae9). Report is 339 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9527 +/- ##
==========================================
+ Coverage 90.34% 90.37% +0.02%
==========================================
Files 346 347 +1
Lines 18194 18163 -31
==========================================
- Hits 16438 16415 -23
+ Misses 1422 1416 -6
+ Partials 334 332 -2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I don't understand how this PR handles the status, or why we move to shutdown to the last call (which I remember I explained that is not possible).
I don't think we need to if we consistently return errors. For shutdown, I lost reference, but meant to ask if we could make it configurable to do first or last. WDYT?
I implemented a boolean parameter to allow to run stop first or last.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
This PR was marked stale due to lack of activity. It will be closed in 14 days.
Closed as inactive. Feel free to reopen if this PR is still being worked on.