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

fix: fix timeout in aws resource detector #2186

Merged

Conversation

arunp0
Copy link
Contributor

@arunp0 arunp0 commented May 8, 2024

Current timeout is 1 sec, which is causing EC2 metadata api request timed out

Which problem is this PR solving?

The current Ec2 metadata API timeout is 1 sec, which is causing frequent "EC2 metadata API request timed out" issues.

Short description of the changes

Increased the metadata API timeout to 5 sec.

Current timeout is 1 sec, which is causing EC2 metadata api request timed out.
Increase the timeout to 5 sec.
@arunp0 arunp0 requested a review from a team May 8, 2024 13:28
Copy link

linux-foundation-easycla bot commented May 8, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@@ -109,7 +109,8 @@ describe('awsEc2Detector', () => {
scope.done();
});

it('should throw when timed out', async () => {
it('should throw when timed out', function (done) {
this.timeout(7000);
Copy link
Contributor

Choose a reason for hiding this comment

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

if you're changing the timeout value for the test, you're not really testing the new value you changed to. Don't you want to test with the 5s?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the timeouts

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.

I wonder - can it practically take this much time for the endpoint to respond? shouldn't it be a localhost call?

Copy link

codecov bot commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.40%. Comparing base (dfb2dff) to head (8363984).
Report is 162 commits behind head on main.

Current head 8363984 differs from pull request most recent head e364811

Please upload reports for the commit e364811 to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2186      +/-   ##
==========================================
- Coverage   90.97%   90.40%   -0.58%     
==========================================
  Files         146      149       +3     
  Lines        7492     7514      +22     
  Branches     1502     1573      +71     
==========================================
- Hits         6816     6793      -23     
- Misses        676      721      +45     
Files Coverage Δ
...ource-detector-aws/src/detectors/AwsEc2Detector.ts 97.91% <ø> (ø)

... and 50 files with indirect coverage changes

@pichlermarc pichlermarc merged commit 9e4726c into open-telemetry:main Jun 13, 2024
13 checks passed
@dyladan dyladan mentioned this pull request Jun 13, 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.

4 participants