-
Notifications
You must be signed in to change notification settings - Fork 807
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
@opentelemetry/exporter-collector fails to remove fulfilled promises #1774
Comments
I'm not able to repro this in node.js for some reason |
Does anyone have an idea what's going on here? It seems like something strange is happening between reference scoping rules, browser JS engines, and compilation. I actually did not see this issue with a production build, so presumably it restructured the code in a way to prevent the issue. I'm happy to flesh out that PR #1775 if that is the way to go. |
Sorry I meant to look into this but as always there are a lot of balls in the air and I just let this one slip through the cracks. @obecny have you seen this? |
seems like it was missed. I have checked and if this is happening then there are several places where it needs to be fixed not only in |
@aabmass your PR is still a draft for so long time so reality is no one will review it when the work is in progress. It needs to be converted to regular PR once you decide it is finished and ready for review. Otherwise people don't know whether it is finished or not. |
@obecny ya it wasn't ready for review, I didn't know if this was just an issue on my side with webpack or babel config. I will update the PR to fix the other occurrence and mark it ready. |
@aabmass whatever suits you better, but yr solution can be applied then to few other places, it can be in yr PR, or I can add this after yr PR will be merged, both works fine. The places I'm talking about can be found by simply searching for |
Please answer these questions before submitting a bug report.
What version of OpenTelemetry are you using?
What version of Node are you using?
v12.19.0
, but the bug appears in the browser (tested on Chrome and Firefox). Strangely, I was not able to repro the problem even though the node exporter looks like it has the same bug.Please provide the code you used to setup the OpenTelemetry SDK
Code is in a repo
What did you do?
Created spans in the browser and tried to export them with
CollectorTraceExporter
. The first few spans send alright, but then I see{"stack":"Error: Concurrent export limit reached\n at CollectorTraceExporter.export ...
exceptions (from here).What did you expect to see?
Spans should export indefinitely without any issue.
CollectorTraceExporter._sendingPromises
list should pop promises as they finish.What did you see instead?
Instead, the list grows indefinitely with fulfilled promises. This code never runs:
opentelemetry-js/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts
Lines 80 to 84 in a2304c9
Additional context
The issue is
promise
is not initialized when it is used here:opentelemetry-js/packages/opentelemetry-exporter-collector/src/platform/browser/CollectorExporterBrowserBase.ts
Line 82 in a2304c9
I was able to determine this by wrapping that line in a try/catch and logging the error (it's not great that the error is swallowed without doing this, makes it very difficult to debug):
Restructuring this code to have a proper reference to the promise solves the issue. See fix PR #1775
The text was updated successfully, but these errors were encountered: