-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Facing multiple Issues while integrating opentelemetry tracing #6791
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
Comments
@raymondfeng, could you please help on this? Thanks. |
Any help here @strongloop/loopback-next ?? |
@bhupesh-sf I will question the design of
|
Propagation of tracing information over outbound http connections is even tricker at this point. It really depends on the connector modules which use their own http client packages. These modules do not support dependency injections. |
@raymondfeng opentelemetry does provide the API but they are giving auto instrumentation for some frameworks like express etc and they do this thing quite well. SO I was thinking if we can leverage the same for Loopback. Otherwise, we have to manually do the same which will take a good amount of work for a framework. |
And the other option of |
Just want to correct one thing - we probably need to create a simple js file as follows: opentelemetry-register.js
Then use |
@bhupesh-sf I suggest that you create a simple LB4 app with your code in |
I have been getting nowhere with NodeTracerProvider. Nothing captured in a stack with redis, graphql, mysql, express. We use es6 code with babel. Could this be the reason? |
@raymondfeng I created a separate file with trace provider and loaded it using Here is an example of my
And here is my I used it inside a monorepo for microservice architecture and it's working all well. Below is the screenshot of the same. Now the QUESTION here is can we do it using inside loopback so every user doesn't have to create this file and add to the project. If YES guide me, I can work on that PR. If NOT then I believe we should document this for the ease of the community. Let me know your thoughts about it. |
@mschipperheyn Please try the above solution it shall work. Please note you have to install all the other auto instrumentation plugins like Let me know if still doesn't work. |
@raymondfeng Can you please suggest on above? |
@raymondfeng Any suggestion on the above? |
@bhupesh-sf did you check #3389 already? |
@nflaig I did it when I started working on opentelemetry not recently. The current implementation which Is available in a separate branch for tracing is based on opentracing not opentelemetry and it's completely broken. The solution I gave above completely works and more can be built upon this. Right now I am short of bandwidth but if someone is interested can pick this up. The above solution works like a charm. |
Steps to reproduce
Install the following packages:
AT the top of index.ts
Following at the top of the main function in index.ts file
Then import the following in the application.ts file:
Then I added this middleware in the application.ts
Then bind this middleware in the constructor in the application.ts:
Another thing if I use
Axios
to make an HTTP request then context propagation happens properly but if I use the recommended way of loopback by creating a rest connector then it doesn't happen. I have installed all the required modules in the app.Current Behavior
Expected Behavior
As per the auto instrument libraries from opentelemetry for HTTP, express, redis, psotgres all opentelemetry modules required to be loaded before any of such application module are loaded. So as per code sample above it should have worked all fine.
Another thing if I use
Axios
to make an HTTP request then context propagation happens properly but if I use the recommended way of loopback by creating a rest connector then it doesn't happen. I have installed all the required modules in the app.Additional information
linux x64 12.18.4
├── UNMET PEER DEPENDENCY @loopback/[email protected]
├── UNMET PEER DEPENDENCY @loopback/[email protected]
├── UNMET PEER DEPENDENCY @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── UNMET PEER DEPENDENCY @loopback/[email protected]
├── @loopback/[email protected]
├── UNMET PEER DEPENDENCY @loopback/[email protected]
├── @loopback/[email protected]
├── @loopback/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├─┬ UNMET DEPENDENCY [email protected]
│ ├── @loopback/[email protected]
│ ├── @loopback/[email protected]
│ ├── @loopback/[email protected]
│ ├── @loopback/[email protected]
│ ├── @loopback/[email protected]
│ ├── [email protected] deduped
├── [email protected]
The text was updated successfully, but these errors were encountered: