@instana/shared-metrics 3.20.2 → 3.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,19 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.21.1](https://github.com/instana/nodejs/compare/v3.21.0...v3.21.1) (2025-03-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - resolved TypeError "eventLoopStats.sense is not a function" ([#1575](https://github.com/instana/nodejs/issues/1575)) ([2e475d3](https://github.com/instana/nodejs/commit/2e475d39b20f5753c58ed119c363844ec346ce69))
11
+ - resolved TypeError gcStats.on is not a function ([12b2134](https://github.com/instana/nodejs/commit/12b2134a4983ba345f8e323a63bd489e0e9074d5))
12
+
13
+ # [3.21.0](https://github.com/instana/nodejs/compare/v3.20.2...v3.21.0) (2024-10-17)
14
+
15
+ ### Features
16
+
17
+ - added v23 support ([#1385](https://github.com/instana/nodejs/issues/1385)) ([34b990f](https://github.com/instana/nodejs/commit/34b990f2ab2a88aa6f2b0730296b7ae75e613ab0))
18
+
6
19
  ## [3.20.2](https://github.com/instana/nodejs/compare/v3.20.1...v3.20.2) (2024-10-09)
7
20
 
8
21
  **Note:** Version bump only for package @instana/shared-metrics
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instana/shared-metrics",
3
- "version": "3.20.2",
3
+ "version": "3.21.1",
4
4
  "description": "Internal metrics plug-in package for Node.js monitoring with Instana",
5
5
  "author": {
6
6
  "name": "Bastian Krol",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  "license": "MIT",
61
61
  "dependencies": {
62
- "@instana/core": "3.20.2",
62
+ "@instana/core": "3.21.1",
63
63
  "detect-libc": "^2.0.2",
64
64
  "event-loop-lag": "^1.4.0",
65
65
  "fs-extra": "^11.2.0",
@@ -76,5 +76,5 @@
76
76
  "event-loop-stats": "1.4.1",
77
77
  "gcstats.js": "1.0.0"
78
78
  },
79
- "gitHead": "b61826870eddc0acbcb29300b809f479500cd7b0"
79
+ "gitHead": "432175203f6f31df372d0e6574c7ad54c14b9624"
80
80
  }
@@ -9,6 +9,9 @@ exports.payloadPrefix = 'activeHandles';
9
9
 
10
10
  Object.defineProperty(exports, 'currentPayload', {
11
11
  get: function () {
12
+ // TODO: _getActiveHandles is deprecated. Replace with getActiveResourcesInfo.
13
+ // https://nodejs.org/api/deprecations.html#dep0161-process_getactiverequests-and-process_getactivehandles
14
+ // Added in v16. Replace in major release.
12
15
  // @ts-ignore
13
16
  return process._getActiveHandles().length;
14
17
  }
package/src/gc.js CHANGED
@@ -43,7 +43,7 @@ exports.currentPayload = {
43
43
 
44
44
  exports.activate = function activate() {
45
45
  activateHasBeenCalled = true;
46
- if (gcStats) {
46
+ if (gcStats && typeof gcStats.on === 'function') {
47
47
  actuallyActivate();
48
48
  }
49
49
  };
@@ -65,7 +65,7 @@ let senseIntervalHandle;
65
65
  nativeModuleLoader.once('loaded', gcStats_ => {
66
66
  gcStats = gcStats_;
67
67
  exports.currentPayload.statsSupported = true;
68
- if (activateHasBeenCalled) {
68
+ if (activateHasBeenCalled && gcStats && typeof gcStats.on === 'function') {
69
69
  actuallyActivate();
70
70
  }
71
71
  });
package/src/libuv.js CHANGED
@@ -42,7 +42,9 @@ Object.defineProperty(exports, 'currentPayload', {
42
42
  });
43
43
 
44
44
  function sense() {
45
- if (eventLoopStats) {
45
+ // CASE: If the c++ module does not support the env, it might export `sense` as undefined.
46
+ // See https://github.com/bripkens/event-loop-stats/blob/v1.4.1/src/eventLoopStats.js#L1-L2
47
+ if (eventLoopStats && eventLoopStats.sense) {
46
48
  const stats = eventLoopStats.sense();
47
49
  stats.statsSupported = true;
48
50
  return stats;