-
Notifications
You must be signed in to change notification settings - Fork 795
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
Do not export empty span lists #896
Do not export empty span lists #896
Conversation
packages/opentelemetry-tracing/src/export/BatchSpanProcessor.ts
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #896 +/- ##
==========================================
- Coverage 94.19% 93.81% -0.38%
==========================================
Files 248 223 -25
Lines 10847 8793 -2054
Branches 1059 857 -202
==========================================
- Hits 10217 8249 -1968
+ Misses 630 544 -86
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@pauldraper would be nice if you can review this one. |
Looks good. I do think that it would be even better to replace setInterval with setTimeout, and invoke it only when there is something to send. In-memory polling is poor citizenry for an application. On dedicated hardware (e.g. server), it's fine, but for other cases (e.g. a desktop app), it's impolite to constantly be using the CPU and preventing memory from paging to disk. |
@pauldraper so instead of having a timer fire every x seconds no matter what, you would have the timer start when the first ended span is added to the list, then when the timer fires it exports all ended spans. There is then not another timer set until onEnd is called again? |
@pauldraper just updated to remove the in-memory polling. PTAL |
LGTM |
Re-requesting reviews because of the changes suggested by @pauldraper |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added one optional nit, otherwise logic lgtm.
Fixes #895