apm-agent-nodejs
apm-agent-nodejs copied to clipboard
perf: only instrument knex if necessary
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.
@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 😃
You could just check for existence of the unwrap function on Knex.Client.
Obsoleted by https://github.com/elastic/apm-agent-nodejs/pull/2879