question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support knex/thenables

See original GitHub issue

Hi, I googled this but was unable to find any reference to this.

Currently, knex.js (which is a heavily used/depended-on library in the nodejs space) basically “slurps up” .then() chains, which means it removes reference to the original stack trace on every async call. This is a well-known issue, and both datadog and elastic-apm have specifically built workarounds for this:

https://github.com/DataDog/dd-trace-js/blob/master/packages/datadog-plugin-knex/src/index.js

https://github.com/elastic/apm-agent-nodejs/blob/master/lib/instrumentation/modules/knex.js

However, it does not seem like newrelic’s agent takes care of scenarios like this where the stack trace is lost through async calls (I believe it’s not only knex, but a couple of other libraries that have this behaviour as well - for example, I’ve heard that apollo-server also has a similar behaviour with async stack traces).

Currently, this would be a hard blocker for any production application utilizing knex.js directly or even indirectly to adopt newrelic’s APM. I don’t know if a fix for this is already implemented, but if not, I would request that newrelic’s APM implement it as well.

Thanks!

Related issues: https://github.com/elastic/apm-agent-nodejs/issues/873 https://github.com/DataDog/dd-trace-js/pull/563

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
taylorlapeyrecommented, Apr 7, 2021

Another +1! Having 0 visibility into queries in new relic just because of Knex is really a kick in the shin

1reaction
JaneJeoncommented, Mar 24, 2021

Hi, any update on this? It is a hard blocker for not just me, but anyone using knex (or any library that uses its own promise implementation, which is a surprising number of them).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Theme Support - Keenthemes
Support Overview. Our support primarily covers all pre and post-sales questions, basic product related questions, and bug reports.
Read more >
Quinable
Welcome to the Client Facility Help Desk. Search. Quinable. Facilities · Providers. Promoted articles. What to do if the App did not capture...
Read more >
Award Winning MES Support - POMS Corporation
MES support portal and contact info. Current customers can schedule a system health check, access new portal, and much more. Talk with a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found