From 875af122ed5ca79f1528d237039375d565d60aaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 08:41:57 +0000 Subject: [PATCH 1/4] Bump word-wrap from 1.2.3 to 1.2.4 Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9049377f..8ae29f47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1892,9 +1892,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrappy": { From dd18cdb23e73abb098004ef2fb3d2366084e6057 Mon Sep 17 00:00:00 2001 From: zodern Date: Thu, 11 Jul 2024 17:18:35 -0500 Subject: [PATCH 2/4] Check for valid error --- lib/tracer/tracer_store.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tracer/tracer_store.js b/lib/tracer/tracer_store.js index f30619e9..25bf87d5 100644 --- a/lib/tracer/tracer_store.js +++ b/lib/tracer/tracer_store.js @@ -60,6 +60,11 @@ TracerStore.prototype._handleErrors = function (trace) { if (lastEvent && lastEvent[2]) { let error = lastEvent[2].error; + if (!error) { + logger('trace does not have valid error', JSON.stringify(trace.events)); + return; + } + // grouping errors occured (reset after processTraces) let errorKey = [trace.type, trace.name, error.message].join('::'); if (!this.errorMap[errorKey]) { From 7ec44f79d676709441835114e410c244b30d9ce4 Mon Sep 17 00:00:00 2001 From: zodern Date: Thu, 11 Jul 2024 17:19:24 -0500 Subject: [PATCH 3/4] v2.49.4 --- CHANGELOG.md | 5 +++++ package.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a67d403..9f4abfa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v2.49.4 +July 11, 2024 + +* Handle traces with invalid errors + ## v2.49.3 June 20, 2024 diff --git a/package.js b/package.js index 0d628779..e38e73f0 100644 --- a/package.js +++ b/package.js @@ -2,7 +2,7 @@ Package.describe({ summary: 'Performance Monitoring for Meteor', - version: '2.49.3', + version: '2.49.4', git: 'https://github.com/monti-apm/monti-apm-agent.git', name: 'montiapm:agent' }); From 6d146367a993091ef35eea5d4838e0bf4d0678e8 Mon Sep 17 00:00:00 2001 From: Alban Date: Wed, 15 May 2024 16:41:02 +0200 Subject: [PATCH 4/4] Add disableInstrumentation option Useful when you want to fully disable instrumentation overhead without remove the package --- README.md | 2 ++ lib/hijack/instrument.js | 4 ++++ 2 files changed, 6 insertions(+) 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;