apm-agent-nodejs icon indicating copy to clipboard operation
apm-agent-nodejs copied to clipboard

perf: only instrument knex if necessary

Open watson opened this issue 7 years ago • 2 comments
trafficstars

If captureSpanStackTraces is disabled, there's no reason to capture the intermediate knex stack trace which is only used to improve the span stack traces of pg and mysql spans.

watson avatar Aug 10 '18 13:08 watson

@Qard I haven't written any tests for this as I wasn't sure exactly how I could test this in a reasonable way. If you have any suggestions that aren't too complicated let me know 😃

watson avatar Aug 10 '18 13:08 watson

You could just check for existence of the unwrap function on Knex.Client.

Qard avatar Aug 10 '18 17:08 Qard

Obsoleted by https://github.com/elastic/apm-agent-nodejs/pull/2879

trentm avatar Aug 31 '22 16:08 trentm