Skip to content

Conversation

@pichlermarc
Copy link
Member

@pichlermarc pichlermarc commented Aug 19, 2024

Which problem is this PR solving?

This is an unreleased bug, therefore not adding a changelog entry.
Priority: P3 (logspam)

A destroyed request is currently treated as never successful and therefore always times out, which causes the PeriodicExportingMetricReader to log an error, even though the request itself was successful.

This PR fixes this issue and adds tests for HttpExporterTransport, added in #4743.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Added unit tests

@pichlermarc pichlermarc changed the title fix(otlp-exporter-base): fix retry-after parsing and handling of destroyed requests fix(otlp-exporter-base): fix handling of destroyed requests Aug 19, 2024
Comment on lines -28 to -31
export const DEFAULT_EXPORT_INITIAL_BACKOFF = 1000;
export const DEFAULT_EXPORT_MAX_BACKOFF = 5000;
export const DEFAULT_EXPORT_BACKOFF_MULTIPLIER = 1.5;

Copy link
Member Author

Choose a reason for hiding this comment

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

reviewer note: this is unrelated. They're not used anymore, so I decided to remove them.

Comment on lines +579 to +586
try {
assert.strictEqual(result.code, core.ExportResultCode.FAILED);
const error = result.error as OTLPExporterError;
assert.ok(error !== undefined);
assert.strictEqual(error.message, 'Request Timeout');
} catch (e) {
done(e);
}
Copy link
Member Author

Choose a reason for hiding this comment

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

reviewer note: i changed this test as to ensure it does not show up as timed out when assertions fail.

@pichlermarc pichlermarc marked this pull request as ready for review August 19, 2024 15:07
@pichlermarc pichlermarc requested a review from a team August 19, 2024 15:07
@pichlermarc pichlermarc marked this pull request as draft August 19, 2024 15:08
@codecov
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.89%. Comparing base (39ab59d) to head (13b306a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4929      +/-   ##
==========================================
- Coverage   93.29%   92.89%   -0.41%     
==========================================
  Files          84      317     +233     
  Lines        1700     8243    +6543     
  Branches      349     1675    +1326     
==========================================
+ Hits         1586     7657    +6071     
- Misses        114      586     +472     
Files Coverage Δ
...ter-base/src/platform/node/http-transport-utils.ts 97.91% <ø> (ø)
...kages/otlp-exporter-base/src/platform/node/util.ts 100.00% <ø> (ø)

... and 241 files with indirect coverage changes

@pichlermarc pichlermarc marked this pull request as ready for review August 19, 2024 15:47
@pichlermarc pichlermarc added bug Something isn't working priority:p3 Bugs which cause problems in user apps not related to correctness (performance, memory use, etc) labels Aug 20, 2024
@pichlermarc pichlermarc added this pull request to the merge queue Aug 21, 2024
Merged via the queue into open-telemetry:main with commit cd4e2bf Aug 21, 2024
@pichlermarc pichlermarc deleted the fix/exporter-bug branch August 21, 2024 09:31
Zirak pushed a commit to Zirak/opentelemetry-js that referenced this pull request Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority:p3 Bugs which cause problems in user apps not related to correctness (performance, memory use, etc) Skip Changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants