@instana/shared-metrics 2.36.1 → 2.36.3

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,47 @@
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
+ ## [2.36.3](https://github.com/instana/nodejs/compare/v2.36.2...v2.36.3) (2025-03-17)
7
+
8
+ **Note:** Version bump only for package @instana/shared-metrics
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.36.2](https://github.com/instana/nodejs/compare/v2.36.1...v2.36.2) (2025-03-17)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * resolved logging issue for the dependency distance calculator ([dcbe478](https://github.com/instana/nodejs/commit/dcbe4784c5485f38146e4e03d91c7090ea481449)), closes [#1019](https://github.com/instana/nodejs/issues/1019)
20
+ * resolved TypeError "eventLoopStats.sense is not a function" ([#1575](https://github.com/instana/nodejs/issues/1575)) ([5696b83](https://github.com/instana/nodejs/commit/5696b8379764ac3ad26ede4d0670062af2086d30))
21
+ * resolved TypeError gcStats.on is not a function ([6c1b6a4](https://github.com/instana/nodejs/commit/6c1b6a4a38821e794ae8e25e516f3c00ad18a2a0))
22
+
23
+
24
+
25
+
26
+
27
+ ## [2.36.2-beta.1](https://github.com/instana/nodejs/compare/v2.36.2-beta.0...v2.36.2-beta.1) (2025-02-20)
28
+
29
+ **Note:** Version bump only for package @instana/shared-metrics
30
+
31
+
32
+
33
+
34
+
35
+ ## [2.36.2-beta.0](https://github.com/instana/nodejs/compare/v2.36.1...v2.36.2-beta.0) (2025-02-20)
36
+
37
+
38
+ ### Bug Fixes
39
+
40
+ * resolved logging issue for the dependency distance calculator ([3d1816e](https://github.com/instana/nodejs/commit/3d1816e95de11ea41e0482af7abed6ed1c1adf53)), closes [#1019](https://github.com/instana/nodejs/issues/1019)
41
+ * resolved TypeError "eventLoopStats.sense is not a function" ([#1575](https://github.com/instana/nodejs/issues/1575)) ([65b8ee7](https://github.com/instana/nodejs/commit/65b8ee72caf90f6c3103c17e1ee00b3c7d118cb3))
42
+
43
+
44
+
45
+
46
+
6
47
  ## [2.36.1](https://github.com/instana/nodejs/compare/v2.36.0...v2.36.1) (2023-12-04)
7
48
 
8
49
  **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": "2.36.1",
3
+ "version": "2.36.3",
4
4
  "description": "Internal metrics plug-in package for Node.js monitoring with Instana",
5
5
  "author": {
6
6
  "name": "Bastian Krol",
@@ -67,7 +67,7 @@
67
67
  },
68
68
  "license": "MIT",
69
69
  "dependencies": {
70
- "@instana/core": "2.36.1",
70
+ "@instana/core": "2.36.3",
71
71
  "detect-libc": "^1.0.3",
72
72
  "event-loop-lag": "^1.4.0",
73
73
  "recursive-copy": "^2.0.13",
@@ -82,5 +82,5 @@
82
82
  "event-loop-stats": "1.4.1",
83
83
  "gcstats.js": "1.0.0"
84
84
  },
85
- "gitHead": "875da9e913e73c6aeca2cf0f454b8421253d7a78"
85
+ "gitHead": "a6b9f1a4fb5bfe176909047feb70b1204d86f873"
86
86
  }
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/index.js CHANGED
@@ -13,7 +13,6 @@ const allMetrics = [
13
13
  require('./dependencies'),
14
14
  require('./directDependencies'),
15
15
  require('./description'),
16
- require('./directDependencies'),
17
16
  require('./execArgs'),
18
17
  require('./gc'),
19
18
  require('./healthchecks'),
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;
@@ -16,7 +16,7 @@ let logger = Logger.getLogger('metrics');
16
16
  /**
17
17
  * @param {import('@instana/core/src/logger').GenericLogger} _logger
18
18
  */
19
- exports.setLogger = function setLogger(_logger) {
19
+ const setLogger = function (_logger) {
20
20
  logger = _logger;
21
21
  };
22
22
 
@@ -277,5 +277,6 @@ function searchInParentDir(dir, onParentDir, callback) {
277
277
  module.exports = {
278
278
  DependencyDistanceCalculator,
279
279
  MAX_DEPTH: 15,
280
- __moduleRefExportedForTest: module
280
+ __moduleRefExportedForTest: module,
281
+ setLogger
281
282
  };
package/src/util/index.js CHANGED
@@ -6,6 +6,7 @@
6
6
  'use strict';
7
7
 
8
8
  const nativeModuleRetry = require('./nativeModuleRetry');
9
+ const { setLogger: setLoggerForDependencyDistanceCalculator } = require('./DependencyDistanceCalculator');
9
10
  module.exports = {
10
11
  nativeModuleRetry,
11
12
  /**
@@ -13,5 +14,6 @@ module.exports = {
13
14
  */
14
15
  setLogger: function setLogger(logger) {
15
16
  nativeModuleRetry.setLogger(logger);
17
+ setLoggerForDependencyDistanceCalculator(logger);
16
18
  }
17
19
  };