appdynamics 25.9.0 → 25.12.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/appdynamics_version.json +3 -3
- package/lib/core/agent.js +18 -4
- package/lib/core/otel-config.js +65 -0
- package/lib/libagent/libagent-connector.js +5 -0
- package/lib/libagent/libagent.js +6 -0
- package/lib/probes/redis-probe.js +15 -3
- package/lib/probes/winston-probe.js +6 -0
- package/lib/profiler/profiler.js +3 -2
- package/package.json +21 -9
- package/packageBck.json +21 -9
- package/preInstallScript.js +0 -6
package/appdynamics_version.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "25.
|
|
3
|
-
"sha": "
|
|
2
|
+
"version": "25.12.1.0",
|
|
3
|
+
"sha": "b6a0faadd4b9487291a9f9adee325eff24432d63",
|
|
4
4
|
"nodeVersion": "",
|
|
5
|
-
"buildName": "
|
|
5
|
+
"buildName": "11096",
|
|
6
6
|
"compatibilityVersion": "4.4.1.0"
|
|
7
7
|
}
|
package/lib/core/agent.js
CHANGED
|
@@ -229,8 +229,7 @@ Agent.prototype.init = function (opts) {
|
|
|
229
229
|
self.backendConnector = new LibAgent(this);
|
|
230
230
|
|
|
231
231
|
// agent_deployment_mode = 'appd' || 'dual' || 'hybrid'
|
|
232
|
-
|
|
233
|
-
if(agent_deployment_mode == 'dual' || opts.openTelemetry && opts.openTelemetry.enabled) {
|
|
232
|
+
if(self.opts.agent_deployment_mode == 'dual' || opts.openTelemetry && opts.openTelemetry.enabled) {
|
|
234
233
|
const url = require('url');
|
|
235
234
|
let collectorEndpoint = process.env.OTEL_EXPORTER_OTLP_ENDPOINT || "http://localhost:4318";
|
|
236
235
|
let collectorEndpointUrl = url.parse(collectorEndpoint);
|
|
@@ -240,11 +239,24 @@ Agent.prototype.init = function (opts) {
|
|
|
240
239
|
};
|
|
241
240
|
try {
|
|
242
241
|
const { start } = require('@splunk/otel');
|
|
243
|
-
|
|
242
|
+
const OtelConfig = require('./otel-config');
|
|
243
|
+
start({
|
|
244
|
+
resource: (detectedResource) =>
|
|
245
|
+
detectedResource.merge(new OtelConfig(opts).configResource()),
|
|
246
|
+
});
|
|
244
247
|
}
|
|
245
248
|
catch (err) {
|
|
246
249
|
self.logger.error('AppDynamics dual mode could not be started ' + err);
|
|
247
250
|
}
|
|
251
|
+
} else if (self.opts.agent_deployment_mode == 'otel') {
|
|
252
|
+
try {
|
|
253
|
+
const { start } = require('@splunk/otel');
|
|
254
|
+
start();
|
|
255
|
+
}
|
|
256
|
+
catch (err) {
|
|
257
|
+
self.logger.error('AppDynamics splunk mode could not be started ' + err);
|
|
258
|
+
}
|
|
259
|
+
return;
|
|
248
260
|
}
|
|
249
261
|
|
|
250
262
|
self.libagentConnector.subscribeToIsEnabled((isEnabled) => setMetadataFile(self, isEnabled));
|
|
@@ -439,7 +451,9 @@ Agent.prototype.initializeOpts = function (opts) {
|
|
|
439
451
|
if (self.opts.analyticsMaxMessageSizeInBytes === undefined && process.env.APPDYNAMICS_ANALYTICS_MAX_MESSAGE_SIZE) {
|
|
440
452
|
self.opts.analyticsMaxMessageSizeInBytes = parseInt(process.env.APPDYNAMICS_ANALYTICS_MAX_MESSAGE_SIZE, 10);
|
|
441
453
|
}
|
|
442
|
-
|
|
454
|
+
if (self.opts.agent_deployment_mode === undefined && process.env.agent_deployment_mode) {
|
|
455
|
+
self.opts.agent_deployment_mode = process.env.agent_deployment_mode;
|
|
456
|
+
}
|
|
443
457
|
};
|
|
444
458
|
|
|
445
459
|
Agent.prototype.fetchMetadata = function (cb) {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) AppDynamics, Inc., and its affiliates
|
|
3
|
+
2015
|
|
4
|
+
All Rights Reserved
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { Resource } = require('@opentelemetry/resources');
|
|
8
|
+
|
|
9
|
+
module.exports = OtelConfig;
|
|
10
|
+
|
|
11
|
+
function OtelConfig(opts) {
|
|
12
|
+
this.resourceAttributes = this.parseResourceAtributes();
|
|
13
|
+
this.tierName = opts.tierName || process.env.APPDYNAMICS_AGENT_TIER_NAME;
|
|
14
|
+
this.applicationName = opts.applicationName || process.env.APPDYNAMICS_AGENT_APPLICATION_NAME;
|
|
15
|
+
this.accountName = opts.accountName || process.env.APPDYNAMICS_AGENT_ACCOUNT_NAME;
|
|
16
|
+
this.DEPLOYMENT_ENVIRONMENT_NAME = "deployment.environment.name";
|
|
17
|
+
this.SERVICE_NAME = "service.name";
|
|
18
|
+
this.SERVICE_NAMESPACE = "service.namespace";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
OtelConfig.prototype.parseResourceAtributes = function() {
|
|
22
|
+
let resourceAttributes = {};
|
|
23
|
+
if(process.env.OTEL_RESOURCE_ATTRIBUTES != null) {
|
|
24
|
+
let parseResourceAttrs = process.env.OTEL_RESOURCE_ATTRIBUTES.split(',');
|
|
25
|
+
for(const attr of parseResourceAttrs) {
|
|
26
|
+
let pairs = attr.split('=');
|
|
27
|
+
if(pairs.length == 2) {
|
|
28
|
+
resourceAttributes[pairs[0]] = pairs[1];
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return resourceAttributes;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
OtelConfig.prototype.configResource = function() {
|
|
36
|
+
let resource = {};
|
|
37
|
+
this.updateServiceNamespace(this.resourceAttributes, resource);
|
|
38
|
+
this.updateServiceName(this.resourceAttributes, resource);
|
|
39
|
+
this.updateDeploymentEnviromentName(this.resourceAttributes, resource);
|
|
40
|
+
return new Resource(resource);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
OtelConfig.prototype.updateServiceNamespace = function(attrs, resource) {
|
|
44
|
+
if(attrs[this.SERVICE_NAMESPACE] != null) {
|
|
45
|
+
return;
|
|
46
|
+
} else {
|
|
47
|
+
resource[this.SERVICE_NAMESPACE] = this.applicationName;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
OtelConfig.prototype.updateServiceName = function(attrs, resource) {
|
|
52
|
+
if(process.env['OTEL_SERVICE_NAME'] != null || attrs[this.SERVICE_NAME] != null) {
|
|
53
|
+
return;
|
|
54
|
+
} else {
|
|
55
|
+
resource[this.SERVICE_NAME] = this.tierName;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
OtelConfig.prototype.updateDeploymentEnviromentName = function(attrs, resource) {
|
|
60
|
+
if(attrs[this.DEPLOYMENT_ENVIRONMENT_NAME] != null) {
|
|
61
|
+
return;
|
|
62
|
+
} else {
|
|
63
|
+
resource[this.DEPLOYMENT_ENVIRONMENT_NAME] = this.accountName;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -191,6 +191,11 @@ LibagentConnector.prototype.startBusinessTransaction = function (entryPointType,
|
|
|
191
191
|
return self.libagent.startBusinessTransaction(entryPointType, optionalName, corrHeader, callback, isHttpRequest);
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
+
LibagentConnector.prototype.dropBusinessTransaction = function (transaction) {
|
|
195
|
+
var self = this;
|
|
196
|
+
self.libagent.dropBusinessTransaction(transaction);
|
|
197
|
+
};
|
|
198
|
+
|
|
194
199
|
LibagentConnector.prototype.stopBusinessTransaction = function (transaction) {
|
|
195
200
|
var self = this;
|
|
196
201
|
|
package/lib/libagent/libagent.js
CHANGED
|
@@ -242,6 +242,12 @@ LibAgent.prototype.startProcessSnapshot = function() {
|
|
|
242
242
|
self.agent.libagentConnector.startProcessSnapshot();
|
|
243
243
|
};
|
|
244
244
|
|
|
245
|
+
LibAgent.prototype.dropBusinessTransaction = function(transaction) {
|
|
246
|
+
var self = this;
|
|
247
|
+
self.agent.libagentConnector.dropBusinessTransaction(transaction);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
|
|
245
251
|
LibAgent.prototype.setRequiresNamingRules = function (flag) {
|
|
246
252
|
var self = this;
|
|
247
253
|
self.agent.setRequiresNamingRules(flag);
|
|
@@ -21,9 +21,8 @@ function wrapExecutor(self, executor) {
|
|
|
21
21
|
var locals = {};
|
|
22
22
|
locals.time = profiler.time();
|
|
23
23
|
locals.args = args;
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
locals.exitCall = self.createExitCall(host, name, args);
|
|
24
|
+
var address = self.getAddress(this.options);
|
|
25
|
+
locals.exitCall = self.createExitCall(address, name, args);
|
|
27
26
|
|
|
28
27
|
var val = executor.call(this, command, args, name);
|
|
29
28
|
var currentCtxt = self.agent.thread.current();
|
|
@@ -44,6 +43,19 @@ function proxyAttachCommands(self, originalObject) {
|
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
45
|
|
|
46
|
+
RedisProbe.prototype.getAddress = function(options) {
|
|
47
|
+
var address = 'localhost:6379';
|
|
48
|
+
if(options && options.url) {
|
|
49
|
+
var urlParsed = new url.URL(options.url);
|
|
50
|
+
address = urlParsed.host;
|
|
51
|
+
} else if (options && options.socket) {
|
|
52
|
+
var host = options.socket.host || 'localhost';
|
|
53
|
+
var port = options.socket.port || '6379';
|
|
54
|
+
address = host + ':' + port;
|
|
55
|
+
}
|
|
56
|
+
return address;
|
|
57
|
+
};
|
|
58
|
+
|
|
47
59
|
RedisProbe.prototype.attachRelative = function(mod, args, obj) {
|
|
48
60
|
var self = this;
|
|
49
61
|
|
|
@@ -28,10 +28,12 @@ WinstonProbe.prototype.attach = function (obj) {
|
|
|
28
28
|
"write",
|
|
29
29
|
(obj, args) => this.handleLogWrite(obj, args)
|
|
30
30
|
);
|
|
31
|
+
self.agent.logger.debug('Attached Winston interceptor');
|
|
31
32
|
};
|
|
32
33
|
|
|
33
34
|
WinstonProbe.prototype.handleLogWrite = function (obj, args) {
|
|
34
35
|
let self = this;
|
|
36
|
+
self.agent.logger.debug('Winston log write intercepted');
|
|
35
37
|
|
|
36
38
|
const threadId = self.agent.profiler.time().threadId;
|
|
37
39
|
const txn = self.agent.profiler.getTransaction(threadId);
|
|
@@ -45,10 +47,12 @@ WinstonProbe.prototype.handleLogWrite = function (obj, args) {
|
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
if(!txn) {
|
|
50
|
+
self.agent.logger.debug('Winston Probe: No active txn Skipping');
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
if(process.env.appdynamics_log_metadata_enrichment || self.agent.libagentConnector.getNodeProperty("enable-log-metadata-enrichment")) {
|
|
55
|
+
self.agent.logger.debug('Winston Probe: Decorate Log message');
|
|
52
56
|
return self.decorateMessage(args, txn, txnBtId);
|
|
53
57
|
}
|
|
54
58
|
};
|
|
@@ -61,8 +65,10 @@ WinstonProbe.prototype.decorateMessage = function (args, txn, btId) {
|
|
|
61
65
|
|
|
62
66
|
let txnGuid = txn && txn.guid ? txn.guid : '';
|
|
63
67
|
if(self.hasMetadataDefined(logMessage)) {
|
|
68
|
+
self.agent.logger.debug('Winston Probe: Log with Metadata');
|
|
64
69
|
self.updateMetadata(logMessage, txnGuid, btId);
|
|
65
70
|
} else {
|
|
71
|
+
self.agent.logger.debug('Winston Probe: No metadata on log, update log message');
|
|
66
72
|
var decorator = self.createDecorator(txnGuid, btId);
|
|
67
73
|
if(decorator) {
|
|
68
74
|
logMessage.message = decorator + ' ' + logMessage.message;
|
package/lib/profiler/profiler.js
CHANGED
|
@@ -34,7 +34,8 @@ Profiler.prototype.init = function () {
|
|
|
34
34
|
var now = Date.now();
|
|
35
35
|
for (var threadId in self.transactions) {
|
|
36
36
|
if (self.transactions[threadId].touched + 300000 < now) {
|
|
37
|
-
self.agent.logger.info('transaction ' + self.transactions[threadId].id + ' dropped');
|
|
37
|
+
self.agent.logger.info('Profiler transaction ' + self.transactions[threadId].id + ' dropped');
|
|
38
|
+
self.agent.backendConnector.dropBusinessTransaction(self.transactions[threadId].btGuid);
|
|
38
39
|
delete self.transactions[threadId];
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -253,7 +254,7 @@ Profiler.prototype.transactionDropped = function (guid) {
|
|
|
253
254
|
|
|
254
255
|
for (var threadId in self.transactions) {
|
|
255
256
|
if (self.transactions[threadId].guid === guid) {
|
|
256
|
-
self.agent.logger.info('transaction ' + self.transactions[threadId].id + ' dropped');
|
|
257
|
+
self.agent.logger.info('Libagent transaction ' + self.transactions[threadId].id + ' dropped');
|
|
257
258
|
delete self.transactions[threadId];
|
|
258
259
|
break;
|
|
259
260
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appdynamics",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.12.1",
|
|
4
4
|
"description": "Performance Profiler and Monitor",
|
|
5
5
|
"author": "AppDynamics, Inc.",
|
|
6
6
|
"homepage": "https://www.appdynamics.com",
|
|
@@ -25,28 +25,40 @@
|
|
|
25
25
|
],
|
|
26
26
|
"main": "./index.js",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"
|
|
28
|
+
"compileDependency": "node buildScripts/dest/compileDependency.js",
|
|
29
|
+
"standAloneAgent": "node buildScripts/dest/createStandAloneAgent.js",
|
|
30
|
+
"runGradleTask": "node buildScripts/dest/runGradleTask.js",
|
|
31
|
+
"createMasterTar": "node buildScripts/dest/createMasterTarFile.js",
|
|
32
|
+
"testStandalone": "node buildScripts/dest/runStandaloneAgent.js",
|
|
33
|
+
"testAgentInstallBeforePublish": "node buildScripts/dest/testAgentInstallBeforePublish.js"
|
|
29
34
|
},
|
|
30
35
|
"directories": {
|
|
31
36
|
"lib": "./lib"
|
|
32
37
|
},
|
|
33
38
|
"optionalDependencies": {
|
|
34
|
-
"n": "^6.8.0"
|
|
35
|
-
"@splunk/otel": "3.0.1"
|
|
39
|
+
"n": "^6.8.0"
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
42
|
+
"@opentelemetry/api": "^1.8.0",
|
|
43
|
+
"@opentelemetry/api-logs": "^0.57.0",
|
|
44
|
+
"@opentelemetry/context-async-hooks": "^2.0.1",
|
|
45
|
+
"@opentelemetry/core": "^1.3.0",
|
|
46
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.57.0",
|
|
47
|
+
"@opentelemetry/exporter-logs-otlp-proto": "^0.57.0",
|
|
48
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.57.0",
|
|
49
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.57.0",
|
|
38
50
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
39
51
|
"body-parser": "^1.20.3",
|
|
40
|
-
"cls-hooked": "4.2.2",
|
|
41
52
|
"https-proxy-agent": "^5.0.1",
|
|
42
53
|
"uuid": "^8.3.2",
|
|
43
54
|
"y18n": "^5.0.8",
|
|
44
|
-
"appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
45
|
-
"appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
46
|
-
"appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
55
|
+
"appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-libagent-napi-node.tgz",
|
|
56
|
+
"appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-native-node.tgz",
|
|
57
|
+
"appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-protobuf-node.tgz"
|
|
47
58
|
},
|
|
48
59
|
"overrides": {
|
|
49
|
-
"semver": "7.5.4"
|
|
60
|
+
"semver": "7.5.4",
|
|
61
|
+
"@grpc/grpc-js": ">=1.10.9"
|
|
50
62
|
},
|
|
51
63
|
"engines": {
|
|
52
64
|
"node": ">=12 <=v22.*"
|
package/packageBck.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "appdynamics",
|
|
3
|
-
"version": "25.
|
|
3
|
+
"version": "25.12.1",
|
|
4
4
|
"description": "Performance Profiler and Monitor",
|
|
5
5
|
"author": "AppDynamics, Inc.",
|
|
6
6
|
"homepage": "https://www.appdynamics.com",
|
|
@@ -25,28 +25,40 @@
|
|
|
25
25
|
],
|
|
26
26
|
"main": "./index.js",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"
|
|
28
|
+
"compileDependency": "node buildScripts/dest/compileDependency.js",
|
|
29
|
+
"standAloneAgent": "node buildScripts/dest/createStandAloneAgent.js",
|
|
30
|
+
"runGradleTask": "node buildScripts/dest/runGradleTask.js",
|
|
31
|
+
"createMasterTar": "node buildScripts/dest/createMasterTarFile.js",
|
|
32
|
+
"testStandalone": "node buildScripts/dest/runStandaloneAgent.js",
|
|
33
|
+
"testAgentInstallBeforePublish": "node buildScripts/dest/testAgentInstallBeforePublish.js"
|
|
29
34
|
},
|
|
30
35
|
"directories": {
|
|
31
36
|
"lib": "./lib"
|
|
32
37
|
},
|
|
33
38
|
"optionalDependencies": {
|
|
34
|
-
"n": "^6.8.0"
|
|
35
|
-
"@splunk/otel": "3.0.1"
|
|
39
|
+
"n": "^6.8.0"
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
42
|
+
"@opentelemetry/api": "^1.8.0",
|
|
43
|
+
"@opentelemetry/api-logs": "^0.57.0",
|
|
44
|
+
"@opentelemetry/context-async-hooks": "^2.0.1",
|
|
45
|
+
"@opentelemetry/core": "^1.3.0",
|
|
46
|
+
"@opentelemetry/exporter-logs-otlp-http": "^0.57.0",
|
|
47
|
+
"@opentelemetry/exporter-logs-otlp-proto": "^0.57.0",
|
|
48
|
+
"@opentelemetry/exporter-trace-otlp-http": "^0.57.0",
|
|
49
|
+
"@opentelemetry/exporter-trace-otlp-proto": "^0.57.0",
|
|
38
50
|
"@yarnpkg/lockfile": "^1.1.0",
|
|
39
51
|
"body-parser": "^1.20.3",
|
|
40
|
-
"cls-hooked": "4.2.2",
|
|
41
52
|
"https-proxy-agent": "^5.0.1",
|
|
42
53
|
"uuid": "^8.3.2",
|
|
43
54
|
"y18n": "^5.0.8",
|
|
44
|
-
"appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
45
|
-
"appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
46
|
-
"appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/25.
|
|
55
|
+
"appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-libagent-napi-node.tgz",
|
|
56
|
+
"appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-native-node.tgz",
|
|
57
|
+
"appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/25.12.1.0/appdynamics-protobuf-node.tgz"
|
|
47
58
|
},
|
|
48
59
|
"overrides": {
|
|
49
|
-
"semver": "7.5.4"
|
|
60
|
+
"semver": "7.5.4",
|
|
61
|
+
"@grpc/grpc-js": ">=1.10.9"
|
|
50
62
|
},
|
|
51
63
|
"engines": {
|
|
52
64
|
"node": ">=12 <=v22.*"
|
package/preInstallScript.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
var nodeVersionParts = process.version.split(".");
|
|
2
|
-
if(parseInt(nodeVersionParts[0].substring(1), 10) < 8) {
|
|
3
|
-
console.log("This version of Appdynamics agent only supports Node.js 8.0 and above. \n"
|
|
4
|
-
+ "For older versions of Node.js please use the AppDynamics agent 4.5.11 by installing with 'npm install appdynamics@4.5.11'");
|
|
5
|
-
process.exit(1);
|
|
6
|
-
}
|