@instana/shared-metrics 1.137.0 → 1.137.4

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 ADDED
@@ -0,0 +1,36 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [1.137.4](https://github.com/instana/nodejs/compare/v1.137.3...v1.137.4) (2022-01-11)
7
+
8
+ **Note:** Version bump only for package @instana/shared-metrics
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.137.3](https://github.com/instana/nodejs/compare/v1.137.2...v1.137.3) (2021-12-16)
15
+
16
+ **Note:** Version bump only for package @instana/shared-metrics
17
+
18
+
19
+
20
+
21
+
22
+ ## [1.137.2](https://github.com/instana/nodejs/compare/v1.137.1...v1.137.2) (2021-11-30)
23
+
24
+ **Note:** Version bump only for package @instana/shared-metrics
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.137.1](https://github.com/instana/nodejs/compare/v1.137.0...v1.137.1) (2021-11-23)
31
+
32
+
33
+ ### Bug Fixes
34
+
35
+ * **dependency:** pinned semver to 7.3.3 ([d32f23e](https://github.com/instana/nodejs/commit/d32f23ea6807989d57ec6165c407b64e04d8d7c1))
36
+ * **dependency:** updated tar to 6.x in shared-metrics ([#415](https://github.com/instana/nodejs/issues/415)) ([5288ba5](https://github.com/instana/nodejs/commit/5288ba5241acd23d54f11c76edb3cffc0ffe6a66))
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instana/shared-metrics",
3
- "version": "1.137.0",
3
+ "version": "1.137.4",
4
4
  "description": "Internal metrics plug-in package for Node.js monitoring with Instana",
5
5
  "author": {
6
6
  "name": "Bastian Krol",
@@ -26,7 +26,7 @@
26
26
  "scripts": {
27
27
  "audit": "bin/prepare-audit.sh && npm audit --production; AUDIT_RESULT=$?; git checkout package-lock.json; exit $AUDIT_RESULT",
28
28
  "test": "npm run test:mocha",
29
- "test:mocha": "mocha --sort --reporter mocha-multi --reporter-options spec=-,xunit=../../test-results/shared-metrics/results.xml $(find test -iname '*test.js' -not -path '*node_modules*')",
29
+ "test:mocha": "echo \"******* Files to be tested:\n $CI_SHARED_METRICS_TEST_FILES\" && mocha --sort --reporter mocha-multi --reporter-options spec=-,xunit=../../test-results/shared-metrics/results.xml ${CI_SHARED_METRICS_TEST_FILES:=$(find test -iname '*test.js' -not -path '*node_modules*')} test/globalHooks_test.js",
30
30
  "test:debug": "WITH_STDOUT=true npm run test:mocha",
31
31
  "lint": "eslint src test",
32
32
  "verify": "npm run lint && npm test",
@@ -52,6 +52,14 @@
52
52
  {
53
53
  "name": "Richard Gebhardt",
54
54
  "email": "gebhardt@us.ibm.com"
55
+ },
56
+ {
57
+ "name": "Willian Carvalho",
58
+ "email": "willian.carvalho@instana.com"
59
+ },
60
+ {
61
+ "name": "Katharina Irrgang",
62
+ "email": "katharina.irrgang@instana.com"
55
63
  }
56
64
  ],
57
65
  "bugs": {
@@ -59,24 +67,20 @@
59
67
  },
60
68
  "license": "MIT",
61
69
  "dependencies": {
62
- "@instana/core": "1.137.0",
70
+ "@instana/core": "1.137.4",
63
71
  "detect-libc": "^1.0.3",
64
72
  "event-loop-lag": "^1.4.0",
65
73
  "recursive-copy": "^2.0.13",
66
- "tar": "^5.0.11"
74
+ "semver": "7.3.3",
75
+ "tar": "^6.1.11"
67
76
  },
68
77
  "devDependencies": {
69
78
  "@types/tar": "^4.0.5",
70
- "eslint": "^7.30.0",
71
- "eslint-config-airbnb-base": "^14.2.1",
72
- "eslint-plugin-import": "^2.23.4",
73
- "eslint-plugin-mocha": "^8.1.0",
74
- "mocha": "^7.2.0",
75
- "prettier": "^2.3.2"
79
+ "no-code2": "2.0.0"
76
80
  },
77
81
  "optionalDependencies": {
78
82
  "event-loop-stats": "1.3.0",
79
83
  "gcstats.js": "1.0.0"
80
84
  },
81
- "gitHead": "1435dbfe13b7091ce08b688b185616b9f6b73061"
85
+ "gitHead": "eb8440ec768cebfb83def798da5770b874d00b4c"
82
86
  }
@@ -239,6 +239,7 @@ function limitAndSet(distances = {}) {
239
239
  for (let i = 0; i < keys.length - exports.MAX_DEPENDENCIES; i++) {
240
240
  delete preliminaryPayload[keys[i]];
241
241
  }
242
+
242
243
  // @ts-ignore: Cannot redeclare exported variable 'currentPayload'
243
244
  exports.currentPayload = preliminaryPayload;
244
245
  }
package/src/gc.js CHANGED
@@ -37,7 +37,8 @@ exports.currentPayload = {
37
37
  majorGcs: 0,
38
38
  incrementalMarkings: 0,
39
39
  weakCallbackProcessing: 0,
40
- gcPause: 0
40
+ gcPause: 0,
41
+ statsSupported: false
41
42
  };
42
43
 
43
44
  exports.activate = function activate() {
@@ -30,11 +30,12 @@ exports.payloadPrefix = 'healthchecks';
30
30
  // @ts-ignore
31
31
  exports.currentPayload = {};
32
32
 
33
- requireHook.onModuleLoad('admin-plugin-healthcheck', function onAdminPluginHealthcheckLoaded(
34
- /** @type {*} */ _adminPluginHealthcheck
35
- ) {
36
- adminPluginHealthcheck = _adminPluginHealthcheck;
37
- });
33
+ requireHook.onModuleLoad(
34
+ 'admin-plugin-healthcheck',
35
+ function onAdminPluginHealthcheckLoaded(/** @type {*} */ _adminPluginHealthcheck) {
36
+ adminPluginHealthcheck = _adminPluginHealthcheck;
37
+ }
38
+ );
38
39
 
39
40
  /**
40
41
  * @param {import('@instana/core/src/util/normalizeConfig').InstanaConfig} config
package/src/libuv.js CHANGED
@@ -47,5 +47,7 @@ function sense() {
47
47
  stats.statsSupported = true;
48
48
  return stats;
49
49
  }
50
- return {};
50
+ return {
51
+ statsSupported: false
52
+ };
51
53
  }
@@ -11,8 +11,8 @@ const EventEmitter = require('events');
11
11
  const copy = require('recursive-copy');
12
12
  const fs = require('fs');
13
13
  const os = require('os');
14
+ const semver = require('semver');
14
15
  const path = require('path');
15
- const tar = require('tar');
16
16
  const detectLibc = require('detect-libc');
17
17
 
18
18
  /**
@@ -171,6 +171,20 @@ function copyPrecompiled(opts, loaderEmitter, callback) {
171
171
 
172
172
  logger.info(`Found a precompiled version for ${opts.nativeModuleName} ${label}, unpacking.`);
173
173
 
174
+ /**
175
+ * tar@6 has dropped support for Node < 10
176
+ * It might work to require tar@6 or to execute commands with tar@6 and Node < 10,
177
+ * but we don't want to risk that a customers application fails - especially if tar@6 adds
178
+ * breaking changes. We decided to disallow this feature.
179
+ */
180
+ if (semver.lt(process.version, '10.0.0')) {
181
+ logger.info(`Skipped copying precompiled version for ${opts.nativeModuleName} ${label} with Node < 10.`);
182
+ callback(false);
183
+ return;
184
+ }
185
+
186
+ const tar = require('tar');
187
+
174
188
  tar
175
189
  .x({
176
190
  cwd: os.tmpdir(),
@@ -203,10 +217,10 @@ function copyPrecompiled(opts, loaderEmitter, callback) {
203
217
  // is, node_modules/${opts.nativeModuleName}). Node.js' module loading infrastructure
204
218
  // (lib/internal/modules/cjs/loader.js and lib/internal/modules/package_json_reader.js) have built-in
205
219
  // caching on multiple levels (for example, package.json locations and package.json contents). If Node.js
206
- // has tried unsuccessfully to load a module or read a package.json from a particular path, it will remember
207
- // and not try to load anything from that path again (a `false` will be put into the cache for that cache
208
- // key). Instead, we force a new path, by adding precompiled to the module path and use the absolute path to
209
- // the module to load it.
220
+ // has tried unsuccessfully to load a module or read a package.json from a particular path,
221
+ // it will remember and not try to load anything from that path again (a `false` will be
222
+ // put into the cache for that cache key). Instead, we force a new path, by adding precompiled
223
+ // to the module path and use the absolute path to the module to load it.
210
224
  opts.loadFrom = targetDir;
211
225
  callback(true);
212
226
  }