# Node Performance - Disable Instrumentation by Function?

**URL:** <https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [July 8, 2021, 11:12am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179 "2021-07-08T11:12:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kris3](https://avatars.discourse-cdn.com/v4/letter/k/d9b06d/32.png) [@kris3](https://discuss.elastic.co/u/kris3)\
**Post date:** [July 8, 2021, 11:12am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/1 "2021-07-08T11:12:45Z")

</div>

Hello,

We have a Node application instrumented w/ the Elastic APM library and configured to send data to an Elastic Cloud deployment. This has been working just fine for months. Recently, a change was made to our application which involved adding a hot path to normal execution. This change has significantly negatively affected application performance. We have adjusted just about every configuration setting methodically with no luck.

Is there any way to tell the Node APM package to completely ignore instrumentation of specific functions - or something similar? We haven't had any luck with the `disableInstrumentations` parameter for the package responsible for making most of the new calls in requests.

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2021, 11:33am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/2 "2021-08-02T11:33:43Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 2, 2021, 11:39am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/3 "2021-08-02T11:39:25Z")

</div>



---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [August 2, 2021, 11:41am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/4 "2021-08-02T11:41:38Z")

</div>

Sorry for the late reply. I moved it to the sub forum that gets monitored by the Node.js devs. Is this question still relevant?

> [@kris3](#):
>
> Recently, a change was made to our application which involved adding a hot path to normal execution.

What kind of hot path did you add? Does it involve an outgoing network call, such as MySql or HTTP?

Which version of the Node.js agent are you using? Try updating to the latest version as we recently implemented some performance improvements.

---

<div class="post-metadata">

**Author:** ![trentm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/trentm/32/77647_2.png) [@trentm](https://discuss.elastic.co/u/trentm)\
**Post date:** [August 3, 2021, 6:22pm UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/5 "2021-08-03T18:22:37Z")

</div>

Specifically versions 3.14.0 and 3.16.0 ([Node.js Agent version 3.x | APM Node.js Agent Reference [3.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/nodejs/current/release-notes-3.x.html#release-notes-3.16.0)) included performance improvements that could be related to what you are seeing.

As a guess, the [`captureSpanStackTraces=false` configuration option](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#capture-span-stack-traces) might help. However, we would more details to be sure. If your new hot path includes creating many more tracing spans than before, then `captureSpanStackTraces` can often be a bottleneck.

The recently added [Configuration options | APM Node.js Agent Reference [3.x] | Elastic](https://www.elastic.co/guide/en/apm/agent/nodejs/current/configuration.html#span-frames-min-duration) configuration option might help if the new hot path creates very short duration spans that you want to exclude from trace reporting.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 8:31am UTC](https://discuss.elastic.co/t/node-performance-disable-instrumentation-by-function/278179/6 "2022-11-04T08:31:25Z")

</div>


