appdynamics 22.2.0 → 22.3.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.
@@ -1,7 +1,7 @@
1
1
  {
2
- "version": "22.2.0.0",
2
+ "version": "22.3.0.0",
3
3
  "sha": "",
4
4
  "nodeVersion": "",
5
- "buildName": "8373",
5
+ "buildName": "8455",
6
6
  "compatibilityVersion": "4.4.1.0"
7
7
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  const opentelemetry_api = require('@opentelemetry/api');
4
4
  const { ROOT_CONTEXT } = require('@opentelemetry/api');
5
- const { BatchSpanProcessor, ConsoleSpanExporter, BasicTracerProvider } = require('@opentelemetry/tracing');
6
- const { CollectorTraceExporter } = require("@opentelemetry/exporter-collector");
5
+ const { BatchSpanProcessor, ConsoleSpanExporter, BasicTracerProvider } = require('@opentelemetry/sdk-trace-base');
6
+ const { OTLPTraceExporter } = require("@opentelemetry/exporter-trace-otlp-proto");
7
7
  const { AsyncHooksContextManager, AsyncLocalStorageContextManager } = require("@opentelemetry/context-async-hooks");
8
8
  const { ParentBasedSampler, AlwaysOnSampler } = require("@opentelemetry/core");
9
9
  const { Resource } = require('@opentelemetry/resources');
@@ -28,33 +28,52 @@ TracerProvider.prototype.register = function(config) {
28
28
  resource: new Resource({
29
29
  [SemanticResourceAttributes.SERVICE_NAME]: config.tierName,
30
30
  "service.name": config.tierName,
31
- "service.namespance": config.applicationName
31
+ "service.namespace": config.applicationName
32
32
  }),
33
33
  });
34
34
 
35
35
  // default collector configuration, can be overridden from agent config
36
- const defaultOptions = {
36
+ const collectorOptions = {
37
37
  attributes: {'service.name': config.tierName,
38
38
  'service.namespace': config.applicationName}
39
39
  };
40
40
 
41
- if (config.openTelemetry && config.openTelemetry.collector) {
42
- Object.assign(defaultOptions, config.openTelemetry.collector);
43
- this.url = defaultOptions.url;
44
- try {
45
- var urlObj = url.parse(this.url);
46
- this.host = urlObj.hostname;
47
- this.port = urlObj.port;
48
- } catch (e) {
49
- this.logger.error('Collector url must be in <host>:<port> format');
50
- return false;
41
+ // batch export config, empty by default
42
+ const batchExporterConfig = {};
43
+
44
+ if (config.openTelemetry) {
45
+ if (config.openTelemetry.collector) {
46
+ Object.assign(collectorOptions, config.openTelemetry.collector);
47
+ this.url = collectorOptions.url;
48
+ try {
49
+ var urlObj = url.parse(this.url);
50
+ this.host = urlObj.hostname;
51
+ this.port = urlObj.port;
52
+ } catch (e) {
53
+ this.logger.error('Collector url must be in <host>:<port> format');
54
+ return false;
55
+ }
56
+ }
57
+ if(config.openTelemetry.exporter) {
58
+ if(config.openTelemetry.exporter.maxExportBatchSize) {
59
+ batchExporterConfig.maxExportBatchSize = config.openTelemetry.exporter.maxExportBatchSize;
60
+ }
61
+ if(config.openTelemetry.exporter.maxQueueSize) {
62
+ batchExporterConfig.maxQueueSize = config.openTelemetry.exporter.maxQueueSize;
63
+ }
64
+ if(config.openTelemetry.exporter.exportTimeoutMillis) {
65
+ batchExporterConfig.exportTimeoutMillis = config.openTelemetry.exporter.exportTimeoutMillis;
66
+ }
67
+ if(config.openTelemetry.exporter.maxExportBatchSize) {
68
+ batchExporterConfig.maxExportBatchSize = config.openTelemetry.exporter.maxExportBatchSize;
69
+ }
51
70
  }
52
71
  }
53
72
 
54
- const exporter = new CollectorTraceExporter(defaultOptions);
55
- provider.addSpanProcessor(new BatchSpanProcessor(exporter));
73
+ const exporter = new OTLPTraceExporter(collectorOptions);
74
+ provider.addSpanProcessor(new BatchSpanProcessor(exporter, batchExporterConfig));
56
75
  if (config.openTelemetry && config.openTelemetry.debug) {
57
- provider.addSpanProcessor(new BatchSpanProcessor(new ConsoleSpanExporter()));
76
+ provider.addSpanProcessor(new BatchSpanProcessor(new ConsoleSpanExporter(), batchExporterConfig));
58
77
  }
59
78
 
60
79
  const majorVersion = parseInt(process.versions.node.split('.')[0]);
@@ -67,4 +86,4 @@ TracerProvider.prototype.register = function(config) {
67
86
 
68
87
  TracerProvider.prototype.getTracer = function(name) {
69
88
  return opentelemetry_api.trace.getTracer(name);
70
- };
89
+ };
@@ -50,26 +50,28 @@ function getAbsoluteUrl(requestUrl, headers) {
50
50
 
51
51
  function getIncomingRequestAttributes(request) {
52
52
  const attributes = {};
53
- const headers = request.headers;
54
- const userAgent = headers ? headers['user-agent'] : null;
55
- const method = request.method || 'GET';
56
- const httpVersion = request.httpVersion;
57
- const requestUrl = request.url ? url.parse(request.url) : null;
58
- const host = requestUrl && requestUrl.host ? requestUrl.host : headers && headers.host ? headers.host : 'localhost';
59
- attributes[SemanticAttributes.HTTP_URL] = getAbsoluteUrl(requestUrl, headers);
60
- attributes[SemanticAttributes.HTTP_HOST] = host;
61
- attributes[SemanticAttributes.HTTP_METHOD] = method;
62
-
63
- if(requestUrl) {
64
- attributes[SemanticAttributes.HTTP_TARGET] = requestUrl.pathname || '/';
65
- }
66
-
67
- if(userAgent) {
68
- attributes[SemanticAttributes.HTTP_USER_AGENT] = userAgent;
69
- }
70
-
71
- if(httpVersion) {
72
- attributes[SemanticAttributes.HTTP_FLAVOR] = httpVersion;
53
+ if (request) {
54
+ const headers = request.headers;
55
+ const userAgent = headers && headers['user-agent'];
56
+ const method = request.method || 'GET';
57
+ const httpVersion = request.httpVersion;
58
+ const requestUrl = request.url && url.parse(request.url);
59
+ const host = requestUrl && requestUrl.host ? requestUrl.host : headers && headers.host ? headers.host : 'localhost';
60
+ attributes[SemanticAttributes.HTTP_URL] = getAbsoluteUrl(requestUrl, headers);
61
+ attributes[SemanticAttributes.HTTP_HOST] = host;
62
+ attributes[SemanticAttributes.HTTP_METHOD] = method;
63
+
64
+ if(requestUrl) {
65
+ attributes[SemanticAttributes.HTTP_TARGET] = requestUrl.pathname || '/';
66
+ }
67
+
68
+ if(userAgent) {
69
+ attributes[SemanticAttributes.HTTP_USER_AGENT] = userAgent;
70
+ }
71
+
72
+ if(httpVersion) {
73
+ attributes[SemanticAttributes.HTTP_FLAVOR] = httpVersion;
74
+ }
73
75
  }
74
76
  return attributes;
75
77
  }
@@ -83,31 +85,33 @@ function getIncomingRequestAttributesOnResponse(response) {
83
85
  }
84
86
 
85
87
  function getOutgoingRequestAttributes(parsedRequest, headers) {
86
- const method = parsedRequest.method || 'GET';
87
- const userAgent = headers ? headers['user-agent'] : null;
88
-
89
88
  const attributes = {};
90
- attributes[SemanticAttributes.HTTP_URL] = getAbsoluteUrl(parsedRequest, headers);
91
- attributes[SemanticAttributes.HTTP_METHOD] = method;
92
- attributes[SemanticAttributes.HTTP_TARGET] = parsedRequest.path || '/';
93
-
89
+ const userAgent = headers && headers['user-agent'] || undefined;
94
90
  if(userAgent) {
95
91
  attributes[SemanticAttributes.HTTP_USER_AGENT] = userAgent;
96
92
  }
93
+
94
+ attributes[SemanticAttributes.HTTP_METHOD] = parsedRequest && parsedRequest.method || 'GET';
95
+ attributes[SemanticAttributes.HTTP_TARGET] = parsedRequest && parsedRequest.path || '/';
96
+
97
+ attributes[SemanticAttributes.HTTP_URL] = getAbsoluteUrl(parsedRequest, headers);
98
+
97
99
  return attributes;
98
100
  }
99
101
 
100
102
  function getOutgoingRequestAttributesOnResponse(response, hostname) {
101
103
  const attributes = {};
102
- const statusCode = response.statusCode;
103
- const httpVersion = response.httpVersion;
104
- const socket = response.socket;
105
- const remotePort = socket ? socket.remotePort : 0;
106
- attributes[SemanticAttributes.HTTP_HOST] = `${hostname}:${remotePort}`;
107
- attributes[SemanticAttributes.HTTP_STATUS_CODE] = statusCode;
108
-
109
- if(httpVersion) {
110
- attributes[SemanticAttributes.HTTP_FLAVOR] = httpVersion;
104
+ if (response) {
105
+ const statusCode = response.statusCode;
106
+ const httpVersion = response.httpVersion;
107
+ const socket = response.socket;
108
+ const remotePort = socket && socket.remotePort || 0;
109
+ attributes[SemanticAttributes.HTTP_HOST] = `${hostname}:${remotePort}`;
110
+ attributes[SemanticAttributes.HTTP_STATUS_CODE] = statusCode;
111
+
112
+ if(httpVersion) {
113
+ attributes[SemanticAttributes.HTTP_FLAVOR] = httpVersion;
114
+ }
111
115
  }
112
116
  return attributes;
113
117
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appdynamics",
3
- "version": "22.2.0",
3
+ "version": "22.3.0",
4
4
  "description": "Performance Profiler and Monitor",
5
5
  "author": "AppDynamics, Inc.",
6
6
  "homepage": "https://www.appdynamics.com",
@@ -34,18 +34,19 @@
34
34
  "n": "^6.7.0"
35
35
  },
36
36
  "dependencies": {
37
- "@opentelemetry/api": "^1.0.3",
38
- "@opentelemetry/exporter-collector": "^0.25.0",
39
- "@opentelemetry/node": "^0.24.0",
40
- "@opentelemetry/semantic-conventions": "^1.0.1",
41
- "@opentelemetry/tracing": "^0.24.0",
37
+ "@opentelemetry/api": "~1.0.3",
38
+ "@opentelemetry/context-async-hooks": "~1.0.1",
39
+ "@opentelemetry/core": "~1.0.1",
40
+ "@opentelemetry/exporter-trace-otlp-proto": "~0.27.0",
41
+ "@opentelemetry/resources": "~1.0.1",
42
+ "@opentelemetry/sdk-trace-base": "~1.0.1",
43
+ "@opentelemetry/semantic-conventions": "~1.0.1",
42
44
  "cls-hooked": "4.2.2",
43
- "n": "^6.7.0",
44
- "shelljs": "^0.8.5",
45
45
  "uuid": "^8.3.2",
46
- "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-libagent-napi-node.tgz",
47
- "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-native-node.tgz",
48
- "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-protobuf-node.tgz"
46
+ "y18n": "^5.0.8",
47
+ "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-libagent-napi-node.tgz",
48
+ "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-native-node.tgz",
49
+ "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-protobuf-node.tgz"
49
50
  },
50
51
  "engines": {
51
52
  "node": ">=12 <=v16.*"
package/packageBck.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appdynamics",
3
- "version": "22.2.0",
3
+ "version": "22.3.0",
4
4
  "description": "Performance Profiler and Monitor",
5
5
  "author": "AppDynamics, Inc.",
6
6
  "homepage": "https://www.appdynamics.com",
@@ -34,18 +34,19 @@
34
34
  "n": "^6.7.0"
35
35
  },
36
36
  "dependencies": {
37
- "@opentelemetry/api": "^1.0.3",
38
- "@opentelemetry/exporter-collector": "^0.25.0",
39
- "@opentelemetry/node": "^0.24.0",
40
- "@opentelemetry/semantic-conventions": "^1.0.1",
41
- "@opentelemetry/tracing": "^0.24.0",
37
+ "@opentelemetry/api": "~1.0.3",
38
+ "@opentelemetry/context-async-hooks": "~1.0.1",
39
+ "@opentelemetry/core": "~1.0.1",
40
+ "@opentelemetry/exporter-trace-otlp-proto": "~0.27.0",
41
+ "@opentelemetry/resources": "~1.0.1",
42
+ "@opentelemetry/sdk-trace-base": "~1.0.1",
43
+ "@opentelemetry/semantic-conventions": "~1.0.1",
42
44
  "cls-hooked": "4.2.2",
43
- "n": "^6.7.0",
44
- "shelljs": "^0.8.5",
45
45
  "uuid": "^8.3.2",
46
- "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-libagent-napi-node.tgz",
47
- "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-native-node.tgz",
48
- "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.2.0.0/appdynamics-protobuf-node.tgz"
46
+ "y18n": "^5.0.8",
47
+ "appdynamics-libagent-napi": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-libagent-napi-node.tgz",
48
+ "appdynamics-native": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-native-node.tgz",
49
+ "appdynamics-protobuf": "https://cdn.appdynamics.com/packages/nodejs/22.3.0.0/appdynamics-protobuf-node.tgz"
49
50
  },
50
51
  "engines": {
51
52
  "node": ">=12 <=v16.*"