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

feat(detector-instana)!: change implementation to DetectorSync interface #2337

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

david-luna
Copy link
Contributor

Context

Another PR moving away from the deprecated Detector interface in order to prepare the codebase for a fix for #2320. This time is for Instana detector.

My reasons to categorize it as a refactor are:

  • SDK handles both interfaces using detectResources from @opentelemetry/resources package. Ref
  • it is unlikely to be used oustide the SDK or auto-instrumentations

Short description of the changes

  • change detect method to be sync
  • update tests

Test changes

Previously the test where expecting the detector to throw but with the new implementation is not possible throw in a synchornous detect method when an async HTTP request fails. The behaviour has been changed to return an empty resource instead. This change is compatible with the current SDK since it actually does the same logic when a detector fails. You can check the detectResources implementation link above.

Copy link

codecov bot commented Jul 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.56%. Comparing base (dfb2dff) to head (5b9c3a2).
Report is 211 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2337      +/-   ##
==========================================
- Coverage   90.97%   90.56%   -0.41%     
==========================================
  Files         146      157      +11     
  Lines        7492     7635     +143     
  Branches     1502     1574      +72     
==========================================
+ Hits         6816     6915      +99     
- Misses        676      720      +44     
Files Coverage Δ
...ctor-instana/src/detectors/InstanaAgentDetector.ts 96.66% <100.00%> (+0.23%) ⬆️

... and 75 files with indirect coverage changes

Copy link
Member

@blumamir blumamir left a comment

Choose a reason for hiding this comment

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

LGTM, but I wonder if we should still mark it as breaking just in case.

…stanaAgentDetectorUnitTest.test.ts

Co-authored-by: Amir Blum <amirgiraffe@gmail.com>
@david-luna david-luna changed the title refactor(detector-instana): change implementation to DetectorSync interface feat(detector-instana)!: change implementation to DetectorSync interface Aug 1, 2024
@david-luna
Copy link
Contributor Author

@basti1302 @kirrg001 is it okay for you to have this breaking change? If not we I can instead add a new detector implementing the sync interface

@basti1302
Copy link
Contributor

Hi David, I do no longer work for IBM/Instana, so I don't have any particular opinion about this.

@david-luna
Copy link
Contributor Author

Thanks @basti1302. Then we will go for the breaking change

@blumamir
Copy link
Member

blumamir commented Aug 7, 2024

As discussed in the last SIG and documented on the PR, it is very unlikely that people out there are calling the InstanaAgentDetector directly and will be affected by changing the implements Detector to implements DetectorSync.

Since the package is still experimental (major version 0), we can make this change as breaking.

@open-telemetry/javascript-approvers any objections before I merge this PR?

@pichlermarc
Copy link
Member

As discussed in the last SIG and documented on the PR, it is very unlikely that people out there are calling the InstanaAgentDetector directly and will be affected by changing the implements Detector to implements DetectorSync.

Since the package is still experimental (major version 0), we can make this change as breaking.

@open-telemetry/javascript-approvers any objections before I merge this PR?

I'm mainly waiting for someone from Instana to comment. Maybe we give it a couple more days until we merge this to ensure they have had enough time to comment.

@blumamir
Copy link
Member

blumamir commented Aug 9, 2024

As discussed in the last SIG and documented on the PR, it is very unlikely that people out there are calling the InstanaAgentDetector directly and will be affected by changing the implements Detector to implements DetectorSync.
Since the package is still experimental (major version 0), we can make this change as breaking.
@open-telemetry/javascript-approvers any objections before I merge this PR?

I'm mainly waiting for someone from Instana to comment. Maybe we give it a couple more days until we merge this to ensure they have had enough time to comment.

@kirrg001 can you please take a look?

@david-luna
Copy link
Contributor Author

As discussed in the last SIG and documented on the PR, it is very unlikely that people out there are calling the InstanaAgentDetector directly and will be affected by changing the implements Detector to implements DetectorSync.
Since the package is still experimental (major version 0), we can make this change as breaking.
@open-telemetry/javascript-approvers any objections before I merge this PR?

I'm mainly waiting for someone from Instana to comment. Maybe we give it a couple more days until we merge this to ensure they have had enough time to comment.

@kirrg001 can you please take a look?

@kirrg001 did you have the chance to look at this PR?

@basti1302 basti1302 removed their assignment Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants