Resolve OTLP export failures instead of rejecting#6856
Closed
alexanderMontague wants to merge 1 commit intomainfrom
Closed
Resolve OTLP export failures instead of rejecting#6856alexanderMontague wants to merge 1 commit intomainfrom
alexanderMontague wants to merge 1 commit intomainfrom
Conversation
The OTLPMetricExporter's internal HTTP retry mechanism can produce unhandled promise rejections that bypass all try/catch layers and crash the CLI process. Fix this at the source by resolving on export failure in InstantaneousMetricReader instead of rejecting, and logging via diag.error(). This makes forceFlush() and shutdown() paths both safe without needing scattered .catch() handlers. Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Contributor
Coverage report
Test suite run success3774 tests passing in 1455 suites. Report generated by 🧪jest coverage report action from b8f39a0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
Related to incident #inv-18682 (February 2026 OTLP failures). Stacks on #6851.
When the OTLP endpoint is unreachable, the
OTLPMetricExporter's internal HTTP retry mechanism produces anOTLPExporterError: Export failed with retryable statusas an unhandled promise rejection. This bypasses all existing try/catch layers (analytics.ts,FailSafeOtelService) because:BaseOtelService.record()is synchronous — the export happens asynchronously via a detachedforceFlush()callexport()callback patternThe existing
.catch(() => {})onforceFlush()only catches theInstantaneousMetricReader.onForceFlush()rejection, not the transport-level rejections from the HTTP exporter internals.WHAT is this pull request doing?
Fixes the problem at the single chokepoint —
InstantaneousMetricReader.onForceFlush():diag.error()at the layer where the failure actually occurs.catch(() => {})fromBaseOtelServicesinceforceFlush()can no longer rejectInstantaneousMetricReaderverifying it resolves on both success and failureThis makes all paths safe (
forceFlush(),shutdown(), and any future callers) without needing scattered.catch()handlers.How to test your changes?
Measuring impact
Checklist
🤖 Generated with Claude Code