diff --git a/README.md b/README.md index 55f876f8..b9eed5b7 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,8 @@ You should use the same method that you used to give the agent the app id and se | disableNtp | OPTIONS_DISABLE_NTP | false | Disable NTP time synchronization used to get the accurate time in case the server or client's clock is wrong | | stalledTimeout | STALLED_TIMEOUT | 1800000 (30m) | Timeout used to detect when methods and subscriptions might be stalled (have been running for a long time and might never return). The value is in milliseconds, and can be disabled by setting it to 0 | | proxy | MONTI_OPTIONS_PROXY | none | Allows you to connect to Monti APM using a proxy | +| disableInstrumentation | MONTI_DISABLE_INSTRUMENTATION | false | Disables instrumentation. Useful for disabling without uninstalling the package | + ### Traces diff --git a/lib/hijack/instrument.js b/lib/hijack/instrument.js index 87d5d222..b6d764a6 100644 --- a/lib/hijack/instrument.js +++ b/lib/hijack/instrument.js @@ -20,6 +20,10 @@ import { wrapRedisOplogObserveDriver } from './redis_oplog'; let instrumented = false; Kadira._startInstrumenting = function (callback) { + if (Meteor.settings?.monti?.disableInstrumentation || process.env.MONTI_DISABLE_INSTRUMENTATION) { + console.log('Monti APM: Instrumentation is disabled.'); + return; + } if (instrumented) { callback(); return;