-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add options for disabling default instrumentation (#664)
* Add options for disabling default instrumentation We previously had the undocumented configuration option `ignoreInstrumentation` that didn't follow our previously set out naming and behavior conventions for configuration options. Split up this configuration option in separate configuration options for the different instrumentations. Closes #519 * Merge the instrumentHttp and https options These two options basically do the same thing, instrument the http and https modules, but there will most likely not be a scenario where one would instrument http requests but not https requests or the other way around. Merge both options into the `instrumentHttp` option so one option disables both instrumentations. * Fix config reading issue for instrument options The client loaded the instrument options too early, before the config was all read properly. This mean the `APPSIGNAL_INSTRUMENT_*` env vars were ignored. * Fix instrument options always returning true The `|| true` fallback for the default value would always set the options to true for the `initCorePlugins` function. Allow the value to be `undefined`, which is necessary because of the `Partial<AppsignalOptions>` argument to the client constructor. We only check if the `instrumentHttp` option value is `false` and not if it's true (the default). If a user explicitly sets it to `false` the instrumentation will not be enabled.
- Loading branch information
Showing
9 changed files
with
70 additions
and
10 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.../nodejs/.changesets/add-config-options-for-disabling-default-instrumentation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
bump: "patch" | ||
type: "add" | ||
--- | ||
|
||
Add config options for disabling default instrumentation like HTTP, HTTPS, PostgreSQL (pg package) and Redis (node-redis package). | ||
|
||
The following configuration options have been added: | ||
|
||
- `instrumentHttp` | ||
- `instrumentPg` | ||
- `instrumentRedis` | ||
|
||
By default these configuration options are set to `true`, which means the instrumentation is active by default. If you want to disable one of these instrumentations, configure it by setting the configuration option to `false`. | ||
|
||
```js | ||
// appsignal.js | ||
// Brief example, see our docs for a full example | ||
|
||
const appsignal = new Appsignal({ | ||
instrumentRedis: false // Disables the node-redis package instrumentation | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters