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

MySQL spans do not link to the active parent span #561

Closed
sstone1 opened this issue Jul 5, 2021 · 0 comments · Fixed by #562
Closed

MySQL spans do not link to the active parent span #561

sstone1 opened this issue Jul 5, 2021 · 0 comments · Fixed by #562
Assignees
Labels
bug Something isn't working

Comments

@sstone1
Copy link
Contributor

sstone1 commented Jul 5, 2021

What version of OpenTelemetry are you using?

^0.21.0

What version of Node are you using?

v14.17.1

What did you do?

We are using OpenTelemetry in a LoopBack 4 application, which connects to a MySQL database and exposes a CRUD API over a database table. LoopBack 4 is built on top of the express, http and mysql libraries, so we are using the instrumentation for these.

What did you expect to see?

We expected to see a single trace for each HTTP request to the LoopBack 4 application, containing various spans - including a span for the request to the MySQL database.

What did you see instead?

We see two traces for each HTTP request to the LoopBack 4 application, one with all the HTTP spans, and another with just the MySQL span.

Additional context

I believe that this problem occurs as the context is getting lost when requesting a connection from the connection pool. I have a patch for the instrumentation code that fixes the problem by binding the callback for getConnection to the active context before passing it into the instrumented code.

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
None yet
Development

Successfully merging a pull request may close this issue.

1 participant