@instana/shared-metrics 2.28.0 → 2.30.0

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,25 @@
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.30.0](https://github.com/instana/nodejs/compare/v2.29.0...v2.30.0) (2023-08-16)
7
+
8
+
9
+ ### Features
10
+
11
+ * added ability to provide a custom package json path ([#839](https://github.com/instana/nodejs/issues/839)) ([f37d898](https://github.com/instana/nodejs/commit/f37d898bcfc5d053b70251854b40b76e396a22b8))
12
+
13
+
14
+
15
+
16
+
17
+ # [2.29.0](https://github.com/instana/nodejs/compare/v2.28.0...v2.29.0) (2023-07-31)
18
+
19
+ **Note:** Version bump only for package @instana/shared-metrics
20
+
21
+
22
+
23
+
24
+
6
25
  # [2.28.0](https://github.com/instana/nodejs/compare/v2.27.0...v2.28.0) (2023-07-27)
7
26
 
8
27
  **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.28.0",
3
+ "version": "2.30.0",
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.28.0",
70
+ "@instana/core": "2.30.0",
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": "5e9d06953d0cf49e5db0438fcc52b81ad5f7f6e8"
85
+ "gitHead": "ba7e784cde9b2cbdb1e66126978a3aaa85abd7cd"
86
86
  }
@@ -24,13 +24,19 @@ const MAX_ATTEMPTS = 20;
24
24
  const DELAY = 1000;
25
25
  let attempts = 0;
26
26
 
27
- exports.activate = function activate() {
27
+ /**
28
+ * @param {import('@instana/core/src/util/normalizeConfig').InstanaConfig} config
29
+ */
30
+ exports.activate = function activate(config) {
28
31
  attempts++;
29
- applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule((err, packageJson) => {
32
+ applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule(config, (err, packageJson) => {
30
33
  if (err) {
31
34
  return logger.warn('Failed to determine main package json. Reason: ', err.message, err.stack);
32
35
  } else if (!packageJson && attempts < MAX_ATTEMPTS) {
33
- setTimeout(exports.activate, DELAY).unref();
36
+ setTimeout(() => {
37
+ exports.activate(config);
38
+ }, DELAY).unref();
39
+
34
40
  return;
35
41
  } else if (!packageJson) {
36
42
  // final attempt failed, ignore silently
package/src/keywords.js CHANGED
@@ -24,13 +24,19 @@ const MAX_ATTEMPTS = 20;
24
24
  const DELAY = 1000;
25
25
  let attempts = 0;
26
26
 
27
- exports.activate = function activate() {
27
+ /**
28
+ * @param {import('@instana/core/src/util/normalizeConfig').InstanaConfig} config
29
+ */
30
+ exports.activate = function activate(config) {
28
31
  attempts++;
29
- applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule((err, packageJson) => {
32
+ applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule(config, (err, packageJson) => {
30
33
  if (err) {
31
34
  return logger.warn('Failed to determine main package json. Reason: ', err.message, err.stack);
32
35
  } else if (!packageJson && attempts < MAX_ATTEMPTS) {
33
- setTimeout(exports.activate, DELAY).unref();
36
+ setTimeout(() => {
37
+ exports.activate(config);
38
+ }, DELAY).unref();
39
+
34
40
  return;
35
41
  } else if (!packageJson) {
36
42
  // final attempt failed, ignore silently
package/src/name.js CHANGED
@@ -24,15 +24,22 @@ exports.MAX_ATTEMPTS = 60;
24
24
  exports.DELAY = 1000;
25
25
  let attempts = 0;
26
26
 
27
- exports.activate = function activate() {
27
+ /**
28
+ * @param {import('@instana/core/src/util/normalizeConfig').InstanaConfig} config
29
+ */
30
+ exports.activate = function activate(config) {
28
31
  attempts++;
29
32
 
30
- applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule((err, packageJson) => {
33
+ applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule(config, (err, packageJson) => {
31
34
  if (err) {
32
35
  return logger.warn('Failed to determine main package json. Reason: ', err.message, err.stack);
33
36
  } else if (!packageJson && attempts < exports.MAX_ATTEMPTS) {
34
37
  logger.debug('Main package.json could not be found. Will try again later.');
35
- setTimeout(exports.activate, exports.DELAY).unref();
38
+
39
+ setTimeout(() => {
40
+ exports.activate(config);
41
+ }, exports.DELAY).unref();
42
+
36
43
  return;
37
44
  } else if (!packageJson) {
38
45
  if (require.main) {
package/src/version.js CHANGED
@@ -23,13 +23,19 @@ const MAX_ATTEMPTS = 20;
23
23
  const DELAY = 1000;
24
24
  let attempts = 0;
25
25
 
26
- exports.activate = function activate() {
26
+ /**
27
+ * @param {import('@instana/core/src/util/normalizeConfig').InstanaConfig} config
28
+ */
29
+ exports.activate = function activate(config) {
27
30
  attempts++;
28
- applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule((err, packageJson) => {
31
+ applicationUnderMonitoring.getMainPackageJsonStartingAtMainModule(config, (err, packageJson) => {
29
32
  if (err) {
30
33
  return logger.warn('Failed to determine main package json. Reason: ', err.message, err.stack);
31
34
  } else if (!packageJson && attempts < MAX_ATTEMPTS) {
32
- setTimeout(exports.activate, DELAY).unref();
35
+ setTimeout(() => {
36
+ exports.activate(config);
37
+ }, DELAY).unref();
38
+
33
39
  return;
34
40
  } else if (!packageJson) {
35
41
  // final attempt failed, ignore silently