opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Offer a way to deal with status report with sharedcomponent.Map

Open atoulme opened this issue 1 year ago • 8 comments
trafficstars

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

atoulme avatar Feb 08 '24 08:02 atoulme

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.

codecov[bot] avatar Feb 08 '24 08:02 codecov[bot]

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?

atoulme avatar Feb 09 '24 16:02 atoulme

I implemented a boolean parameter to allow to run stop first or last.

atoulme avatar Feb 12 '24 16:02 atoulme

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Feb 27 '24 03:02 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Mar 13 '24 03:03 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Apr 03 '24 03:04 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar Apr 19 '24 03:04 github-actions[bot]

This PR was marked stale due to lack of activity. It will be closed in 14 days.

github-actions[bot] avatar May 08 '24 03:05 github-actions[bot]

Closed as inactive. Feel free to reopen if this PR is still being worked on.

github-actions[bot] avatar May 22 '24 03:05 github-actions[bot]