appdynamics 22.7.0 → 22.11.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/README.md CHANGED
@@ -6,14 +6,17 @@ You can monitor your Node.js applications in production with the AppDynamics Nod
6
6
  Performance issues can result in a slow or unavailable website. The Node.js Agent uses process-level visibility and proactive monitoring to reveal the internal workings of your application and infrastructure with policies, troubleshooting, and performance/capacity optimization. You can use process snapshots to examine your code execution at the multi-process level and identify the root cause of slow performance in minutes.
7
7
 
8
8
  For supported Node.js versions, operating systems, and backends, see [Node.js Supported Environments](https://docs.appdynamics.com/display/PRO21/Node.js+Supported+Environments).
9
-
9
+
10
+
11
+
10
12
  Before You Begin
11
13
  --
12
14
  To start the Node.js Agent, complete the following:
13
15
 
14
16
  - Obtain an AppDynamics account with a running Controller.
15
17
  - To sign up for a 15-day free trial, see [AppDynamics Free Trial](https://www.appdynamics.com/free-trial/). You should receive an email with your Controller host and port.
16
-
18
+
19
+
17
20
  Install the Node.js Agent
18
21
  --
19
22
  AppDynamics recommends that you update the Node.js Agent with every SaaS Controller release. To ensure that your agent contains the latest functionality and fixes, regularly update to a major Node.js Agent version.
@@ -56,4 +59,128 @@ require('appdynamics').profile({
56
59
 
57
60
  For more information, see [Install the Node.js Agent](https://docs.appdynamics.com/display/PRO21/Install+the+Node.js+Agent) and [Application Monitoring](https://docs.appdynamics.com/display/PRO21/Application+Monitoring).
58
61
 
62
+ <br />
63
+ <br />
64
+
65
+
66
+ Developer Guide
67
+ --
68
+ <br />
69
+
70
+ ### How to setup project locally
71
+
72
+ &emsp;Make sure you have stable node version installed ** 12 <= node <= 18 **
73
+ &emsp;are current supported versions.
74
+
75
+ &emsp;We recommend using 16 or above.
76
+
77
+ ```sh
78
+ cd agent-dlnative/nodejs
79
+ npm install
80
+ ```
81
+
82
+ <br />
83
+
84
+ #### Build project
85
+
86
+ &emsp;We currently build the nodejs project with gradle. For more help https://docs.gradle.org/current/userguide/command_line_interface.html
87
+
88
+ &emsp;The root gradle file will be one level up i.e in root of agent-dlnative project.
89
+ &emsp;The **nodejs build.gradle** file has all the task definitions and build logic.
90
+
91
+ ```sh
92
+ ../gradlew dev
93
+ ```
94
+ The above will build the project with local node version.
95
+
96
+ ```sh
97
+ ../gradlew
98
+ ```
99
+ To run build with configured node version in build.gradle
100
+ <br />
101
+
102
+ #### To run agent unit tests
103
+ ```sh
104
+ ../gradlew unittests_agent --info -Dnodejs.build.debug=true -Dnodejs.coverage.enabled=false
105
+ ```
106
+ The above is an example to run unit tests for agent with coverage disabled
107
+
108
+ More example options for task are : ** unittests, integrationtests_agent, eslint **
109
+
110
+ Checkout more options : **/nodejs/build.gradle**
111
+
112
+ <br />
113
+
114
+ #### To create standalone build
115
+
116
+ ```sh
117
+ ../gradlew :nodejs:createStandAloneAgentForNodeVersion or ../gradlew createStandAloneAgentForNodeVersion
118
+ ```
119
+
120
+ Other options are : **createMasterTarNpmScript, testStandalonePackage**
121
+
122
+
123
+ <br />
124
+
125
+ #### Where are these build settings / logic
126
+
127
+ &emsp;The logic to create packages and supported node versions are in **nodejs/buildScripts/src** folder.
128
+
129
+ &emsp;Check package.json to see what npm-scripts are available.
130
+
131
+ &emsp;You can individually run them as a npm command `npm run-script &standAloneAgent`
132
+
133
+ <br />
134
+
135
+ #### How to test applications with local changes in a test application
136
+
137
+ &emsp;Create an npm application
138
+ &emsp;Install appdynamics pointing to your local build
139
+ ```sh
140
+ npm install appdynamics {path_to_your_local_build_folder}/appdynamics
141
+ ```
142
+
143
+ &emsp;Require appdynamics as demonstrated on top section of the readme
144
+ &emsp;example
145
+
146
+ ```sh
147
+ appd.profile({
148
+ accountName: 'e2e-customer',
149
+ accountAccessKey: 'e10aa1c5-29be-474b-bb51-ab0c56eea5e8',
150
+ controllerHostName: 'master-saas-controller.e2e.appd-test.com',
151
+ controllerPort: 8090,
152
+ applicationName: 'upstream-test',
153
+ tierName: 'enabled',
154
+ openTelemetry: {
155
+ enabled: true,
156
+ },
157
+ nodeName: 'node__gql',
158
+ enableGraphQL: true,
159
+ libagent: true,
160
+ debug: true,
161
+ });
162
+ ```
163
+
164
+ &emsp; 1. Run your application and make requests
165
+ &emsp; 2. Go to controller ui - example : https://master-saas-controller.e2e.appd-test.com
166
+ &emsp; 3. Search for your application - example: upstream-test
167
+
168
+ <br />
169
+
170
+ ### Frequently asked questions
171
+
172
+ 1. My Application doesn't show up in the controller
173
+ &emsp;You probably have to update the access key.
174
+
175
+ 2. My integration tests throw "not able to find a module" running locally
176
+ &emsp;Go to your integration test folder - find package.json and run npm install there
177
+ <br />
178
+
179
+ ### How do I setup libagent locally
180
+ &emsp; https://confluence.corp.appdynamics.com/pages/viewpage.action?spaceKey=AMC&title=NodeJS+Agent+with+Local+Libagent
181
+
182
+ <br />
183
+ <br />
184
+ <br />
185
+
59
186
  Copyright (c) AppDynamics, Inc. 2021 CA. All rights reserved.
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "22.7.0.0",
2
+ "version": "22.11.0.0",
3
3
  "sha": "",
4
4
  "nodeVersion": "",
5
- "buildName": "8783",
5
+ "buildName": "8997",
6
6
  "compatibilityVersion": "4.4.1.0"
7
7
  }
package/lib/core/agent.js CHANGED
@@ -158,9 +158,9 @@ Agent.computeTmpDir = function (rootTmpDir,
158
158
  nodeName.toString();
159
159
  // We don't need cryptographic security here,
160
160
  // just a unique, predictable fixed length directory name.
161
- var md5 = crypto.createHash('md5');
162
- md5.update(stringToHash);
163
- return path.join(rootTmpDir, md5.digest('hex'));
161
+ var sha256 = crypto.createHash('sha256');
162
+ sha256.update(stringToHash);
163
+ return path.join(rootTmpDir, sha256.digest('hex').slice(0, 32));
164
164
  };
165
165
 
166
166
  /* istanbul ignore next -- requires too much stubbing and mocking to unit test */
@@ -13,6 +13,7 @@ const url = require('url');
13
13
 
14
14
  module.exports = TracerProvider;
15
15
 
16
+
16
17
  function TracerProvider(logger) {
17
18
  this.host = 'localhost';
18
19
  this.port = '4318';
@@ -38,7 +39,8 @@ TracerProvider.prototype.register = function(config) {
38
39
  }),
39
40
  resource: new Resource({
40
41
  [SemanticResourceAttributes.SERVICE_NAME]: config.tierName,
41
- [SemanticResourceAttributes.SERVICE_NAMESPACE]: config.applicationName
42
+ [SemanticResourceAttributes.SERVICE_NAMESPACE]: config.applicationName,
43
+ [SemanticResourceAttributes.CONTAINER_ID]: ""
42
44
  }),
43
45
  });
44
46
 
@@ -99,3 +101,9 @@ TracerProvider.prototype.register = function(config) {
99
101
  TracerProvider.prototype.getTracer = function(name) {
100
102
  return opentelemetry_api.trace.getTracer(name);
101
103
  };
104
+
105
+ TracerProvider.prototype.updateResourceAttributes = function(attrs) {
106
+ for(let [key, value] of Object.entries(attrs)) {
107
+ this.getTracer().resource.attributes[key] = value;
108
+ }
109
+ };
@@ -107,6 +107,8 @@ LibagentConnector.prototype.init = function () {
107
107
  self.manualProcessSnapshotInProgress = false;
108
108
 
109
109
  self.libagent.init(self.agent);
110
+ self.agent.TracerProvider && self.agent.TracerProvider.updateResourceAttributes({ "container.id": self.getContainerId() });
111
+
110
112
  self.exceptionHandlers = new ExceptionHandlers();
111
113
  self.exceptionHandlers.init(
112
114
  self.agent,
@@ -596,3 +598,8 @@ LibagentConnector.prototype.setupEum = function (agent) {
596
598
  return true;
597
599
  };
598
600
  };
601
+
602
+ LibagentConnector.prototype.getContainerId = function () {
603
+ var self = this;
604
+ return self.libagent.getContainerId();
605
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appdynamics",
3
- "version": "22.7.0",
3
+ "version": "22.11.0",
4
4
  "description": "Performance Profiler and Monitor",
5
5
  "author": "AppDynamics, Inc.",
6
6
  "homepage": "https://www.appdynamics.com",
@@ -45,12 +45,13 @@
45
45
  "https-proxy-agent": "^5.0.0",
46
46
  "uuid": "^8.3.2",
47
47
  "y18n": "^5.0.8",
48
- "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-libagent-napi-node.tgz",
49
- "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-native-node.tgz",
50
- "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-protobuf-node.tgz"
48
+ "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-libagent-napi-node.tgz",
49
+ "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-native-node.tgz",
50
+ "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-protobuf-node.tgz"
51
51
  },
52
52
  "engines": {
53
- "node": ">=12 <=v16.*"
53
+ "node": ">=12 <=v18.*"
54
54
  },
55
- "engine-strict": true
55
+ "engine-strict": true,
56
+ "bundleDependencies": []
56
57
  }
package/packageBck.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appdynamics",
3
- "version": "22.7.0",
3
+ "version": "22.11.0",
4
4
  "description": "Performance Profiler and Monitor",
5
5
  "author": "AppDynamics, Inc.",
6
6
  "homepage": "https://www.appdynamics.com",
@@ -45,12 +45,13 @@
45
45
  "https-proxy-agent": "^5.0.0",
46
46
  "uuid": "^8.3.2",
47
47
  "y18n": "^5.0.8",
48
- "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-libagent-napi-node.tgz",
49
- "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-native-node.tgz",
50
- "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.7.0.0/appdynamics-protobuf-node.tgz"
48
+ "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-libagent-napi-node.tgz",
49
+ "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-native-node.tgz",
50
+ "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.11.0.0/appdynamics-protobuf-node.tgz"
51
51
  },
52
52
  "engines": {
53
- "node": ">=12 <=v16.*"
53
+ "node": ">=12 <=v18.*"
54
54
  },
55
- "engine-strict": true
55
+ "engine-strict": true,
56
+ "bundleDependencies": []
56
57
  }