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

[dd-trace 2.11.0] Missing tracking data #2223

Closed
alvarofpp opened this issue Jul 27, 2022 · 10 comments
Closed

[dd-trace 2.11.0] Missing tracking data #2223

alvarofpp opened this issue Jul 27, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@alvarofpp
Copy link

Context
I have a BFF that uses 'dd-trace' version 2.6.0, this BFF communicates with various services. The problem occurs when I update the version of 'dd-trace' to 2.11.0.

Expected behaviour
The tracer should show the request data, including the moments it interacts with other services. Example:

ddtrace-2 6 0-clear

Actual behaviour
It is not showing interactions with other services.

ddtrace-2 11 0-clear

Steps to reproduce
Take any application that is tracking requests from an endpoint, this application should interact with other services when this endpoint is called, update the version of dd-trace to 2.11.0.

Environment

  • Operation system: Platform: GNU/Linux - CPU: Intel(R) Xeon(R) Platinum 8259CL CPU @ 2.50GHz - Memory: 16.46G
  • Node.js version: v16.15.1
  • Tracer version: 2.6.0 and 2.11.0
  • Agent version: v7.32.4
  • Relevant library versions:
    • express: 4.17.1
@alvarofpp alvarofpp added the bug Something isn't working label Jul 27, 2022
@rochdev
Copy link
Member

rochdev commented Jul 28, 2022

Is the tracer initialized before any instrumented module is imported? This is a requirement for dd-trace to work properly and the behaviour is undefined and can change from version to version of it's not the case. This is usually the issue when spans for a specific integration are completely missing. If they are still reported but in a separate trace, then let me know as that would then be something else completely.

@alvarofpp
Copy link
Author

@rochdev The tracer initializes before all other modules. Your location in the code has not changed with the version update.

the behaviour is undefined and can change from version to version of it's not the case

Would you know if you have any attributes in the require('dd-trace').init(); that may have changed this behavior?

@rochdev
Copy link
Member

rochdev commented Jul 28, 2022

We have re-written the plugin system and in some cases it's more prone to issues when the tracer is not initialized in the right location, at least right now. Can you share your application entry point? I'd like to make sure there aren't any hard to detect issues like hoisting for example.

@mariuszbeltowski
Copy link

@rochdev is there any way to enable debug in tracer to see if it connects well with the agent and sends data?

@rochdev
Copy link
Member

rochdev commented Aug 16, 2022

@mariuszbeltowski Yes but it's extremely verbose, so it's recommended to enable it only to debug issues. This can be configured with DD_TRACE_DEBUG=true.

@rochdev
Copy link
Member

rochdev commented Aug 16, 2022

@alvarofpp Were you able to solve the original issue? If not, can you try with 2.13.0? We made further changes to the plugin system that could hopefully fix the issue. Otherwise we'll definitely need a reproduction snippet.

@alvarofpp
Copy link
Author

@rochdev I'll try 2.13.0 this week or the next, then come back here informing you what happened.

@dyarleniber
Copy link

@rochdev
I had a similar issue, after upgrading to version 2.11 I noticed that the HTTP route paths were missing from the APM dashboards:
image

I resolved this by upgrading to version 3.0.0 and moving just the library import to the top of my entry point file.
However, I am not initializing the library at the very beginning.

My entry point file looks like this:

import dataDogTracer from 'dd-trace';
import express from 'express';
import winston from 'winston';
// ... some other lib imports

const logger = winston.createLogger({
  // ...
});

dataDogTracer.init({
  logInjection: true,
  runtimeMetrics: true,
  logger
});

// ...

Given your comment above:

"Is the tracer initialized before any instrumented module is imported? This is a requirement for dd-trace to work properly and the behaviour is undefined and can change from version to version of it's not the case. This is usually the issue when spans for a specific integration are completely missing. ..."

It seems to be working fine now, but do you think it's possible that I may have issues again with future versions of the library?

@rochdev
Copy link
Member

rochdev commented Aug 19, 2022

It seems to be working fine now, but do you think it's possible that I may have issues again with future versions of the library?

@dyarleniber We plan to remove the initialization requirement from 4.0 completely, so for future versions it should be fine. The library will still need to be imported first, but can be initialized anywhere. There are already a few changes in 3.0 to make this work better, so you might just be benefiting from those improvements.

@alvarofpp
Copy link
Author

I updated the dd-trace version to 3.0.0 in my project and it worked! I don't know what didn't work between versions >2.6.0 and <3.0.0. Thank you guys, especially @rochdev for the support and @dyarleniber for the report.

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

No branches or pull requests

4 participants