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

Promise.all structures produce unlinked spans #16

Closed
wdalmut opened this issue Apr 7, 2020 · 4 comments
Closed

Promise.all structures produce unlinked spans #16

wdalmut opened this issue Apr 7, 2020 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@wdalmut
Copy link
Owner

wdalmut commented Apr 7, 2020

If i use a structure like

Promise.all([
  ModelName
  .find(where)
  .skip(0)
  .limit(25)
  .sort({ fieldName: 'asc' }),
  ModelName.countDocuments(where)
])

Spans are correctly generated but not linked with main root span (appears as two separated spans).

@wdalmut wdalmut added the bug Something isn't working label Apr 7, 2020
@wdalmut wdalmut added this to the 0.1.0 milestone Apr 7, 2020
@wdalmut wdalmut self-assigned this Apr 7, 2020
@wdalmut wdalmut added this to To do in Alpha OpenTelemetry Plugin Mongoose via automation Apr 7, 2020
@wdalmut wdalmut moved this from To do to In progress in Alpha OpenTelemetry Plugin Mongoose Apr 7, 2020
@wdalmut
Copy link
Owner Author

wdalmut commented Apr 7, 2020

this issue is strange... Two spans are correctly generated but sadly with two completely different traceId

@wdalmut
Copy link
Owner Author

wdalmut commented Apr 7, 2020

The problem seems related to Promise.all structure and promise concatenation

Product.find().then(...) // everything looks good

Promise.find().then(() => Product.countDocuments()).then(...) // 1 span only correctly linked with the root span 

Promise.all([Product.find(), Product.countDocuments()).then(...) // no span linked with root span

@wdalmut
Copy link
Owner Author

wdalmut commented Apr 7, 2020

I found the same problem with the opentelemetry mysql-plugin open-telemetry/opentelemetry-js#940

@wdalmut
Copy link
Owner Author

wdalmut commented May 23, 2020

This should be fixed by #34

@wdalmut wdalmut closed this as completed May 23, 2020
Alpha OpenTelemetry Plugin Mongoose automation moved this from In progress to Done May 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
1 participant