whatap 0.4.80 → 0.4.82

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.
@@ -7,6 +7,7 @@
7
7
 
8
8
  var TraceContextManager = require('../trace/trace-context-manager'),
9
9
  SqlStepX = require('../step/sql-stepx'),
10
+ DBCStep = require('../step/dbc-step'),
10
11
  ResultSetStep = require('../step/resultset-step'),
11
12
  HashUtil = require('../util/hashutil'),
12
13
  DataTextAgent = require('../data/datatext-agent'),
@@ -22,8 +23,37 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
22
23
  mod.__whatap_observe__ = true;
23
24
 
24
25
  Logger.initPrint("MongoObserver");
25
-
26
+
26
27
  var self = this;
28
+ var conn_dbc_hash=0;
29
+ var dbc = '';
30
+ self.agent.aop.both(mod.MongoClient.prototype, ['connect'], function (obj, args, lctx) {
31
+ var ctx = TraceContextManager.getCurrentContext();
32
+ if(ctx == null) { return; }
33
+ lctx.context = ctx;
34
+
35
+ if(obj.s && obj.s.url){
36
+ dbc = obj.s.url;
37
+ conn_dbc_hash = HashUtil.hashFromString(dbc);
38
+ DataTextAgent.DBC.add(conn_dbc_hash, dbc);
39
+ DataTextAgent.METHOD.add(conn_dbc_hash, dbc);
40
+ DataTextAgent.ERROR.add(conn_dbc_hash, dbc);
41
+ }
42
+
43
+ var dbc_step = new DBCStep();
44
+ dbc_step.hash = conn_dbc_hash;
45
+ dbc_step.start_time = ctx.getElapsedTime();
46
+
47
+ lctx.step = dbc_step;
48
+ }, function (obj, args, ret, lctx) {
49
+ var pool = ret;
50
+ var ctx = lctx.context,
51
+ step = lctx.step;
52
+
53
+ if(ctx == null || step == null) { return; }
54
+ step.elapsed = ctx.getElapsedTime() - step.start_time;
55
+ ctx.profile.push(step);
56
+ });
27
57
 
28
58
  var insertCommnad = ['insert', 'insertOne', 'insertMany'];
29
59
  insertCommnad.forEach(function (command) {
@@ -35,7 +65,10 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
35
65
  var sql_step;
36
66
  try {
37
67
  sql_step = new SqlStepX();
38
- var sql = 'mongodb ' + command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
68
+ var sql = command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
69
+ if(args[0]){
70
+ sql += ' field=' + JSON.stringify(Object.keys(args[0]))
71
+ }
39
72
  sql_step.hash = HashUtil.hashFromString(sql);
40
73
  sql_step.start_time = ctx.getElapsedTime();
41
74
  //sql_step.crud = 'I'.charCodeAt(0);
@@ -50,13 +83,13 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
50
83
  if(TraceContextManager.resume(ctx._id) == null || sql_step == null) { return; }
51
84
 
52
85
  ctx.footprint('Mongodb Command Done: ' + command );
53
-
86
+
54
87
  sql_step.elapsed = ctx.getElapsedTime() - sql_step.start_time;
55
88
  });
56
89
  });
57
90
  });
58
91
 
59
- var findCommand = ['find', 'findOne', 'findMany'];
92
+ var findCommand = ['find'];
60
93
  findCommand.forEach(function (command) {
61
94
  self.agent.aop.both(mod.Collection.prototype, command, function (obj, args, lctx) {
62
95
  var ctx = lctx.context;
@@ -65,13 +98,19 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
65
98
  ctx.footprint('Mongodb Command Start: ' + command );
66
99
  var sql_step;
67
100
  try {
68
- sql_step = new SqlStepX();
69
- var sql = 'mongodb ' + command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
70
- sql_step.hash = HashUtil.hashFromString(sql);
71
- sql_step.start_time = ctx.getElapsedTime();
72
- //sql_step.crud = 'S'.charCodeAt(0);
73
- DataTextAgent.SQL.add(sql_step.hash, sql);
74
- ctx.profile.push(sql_step);
101
+ if(dbc){
102
+ sql_step = new SqlStepX();
103
+ var sql = command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
104
+ if(args[0]){
105
+ sql += ' where=' + JSON.stringify(Object.keys(args[0]))
106
+ }
107
+ sql_step.hash = HashUtil.hashFromString(sql);
108
+ sql_step.start_time = ctx.getElapsedTime();
109
+ //sql_step.crud = 'S'.charCodeAt(0);
110
+ DataTextAgent.SQL.add(sql_step.hash, sql);
111
+ ctx.profile.push(sql_step);
112
+ }
113
+
75
114
  } catch (e) {
76
115
  Logger.printError("WHATAP-606", "Mongodb find error", e, false);
77
116
  sql_step = null;
@@ -93,7 +132,7 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
93
132
  result_step.start_time = ctx.getElapsedTime();
94
133
  result_step.sqlhash = sql_step.hash;
95
134
  ctx.profile.push(result_step);
96
-
135
+
97
136
  ctx.footprint('Mongodb Fetch Start');
98
137
 
99
138
  self.agent.aop.functionHook(args, -1, null, function (obj, args) {
@@ -134,7 +173,7 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
134
173
  if(TraceContextManager.resume(ctx._id) == null) { return; }
135
174
 
136
175
  ctx.footprint('Mongodb Fetch Done');
137
-
176
+
138
177
  if(args[0]) { return; }
139
178
  result_step.elapsed = ctx.getElapsedTime() - result_step.start_time;
140
179
  if(Array.isArray(args[1])) {
@@ -158,8 +197,14 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
158
197
  var sql_step;
159
198
  try{
160
199
  sql_step = new SqlStepX();
161
- var sql = 'mongodb ' + command ;//+ ': set=' + JSON.stringify(Object.keys(args[1]))
162
- // + ', where=' + JSON.stringify(Object.keys(args[0]));
200
+ var sql = command ;//+ ': set=' + JSON.stringify(Object.keys(args[1]))
201
+ if(args[0]){
202
+ sql += ' where=' + JSON.stringify(Object.keys(args[0]))
203
+ }
204
+ if(args[1]){
205
+ if(args[1]['$set']) sql += ', field=' + JSON.stringify(Object.keys(args[1]['$set']));
206
+ else sql += ' field =' + JSON.stringify(Object.keys(args[1]));
207
+ }
163
208
  sql_step.hash = HashUtil.hashFromString(sql);
164
209
  sql_step.start_time = ctx.getElapsedTime();
165
210
  //sql_step.crud = 'U'.charCodeAt(0);
@@ -172,7 +217,7 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
172
217
 
173
218
  self.agent.aop.functionHook(args, -1, null, function (obj, args) {
174
219
  if(TraceContextManager.resume(ctx._id) == null || sql_step == null) { return; }
175
-
220
+
176
221
  ctx.footprint('Mongodb Command Done: '+command);
177
222
 
178
223
  if(args[0] != null) {
@@ -195,11 +240,14 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
195
240
  var ctx = TraceContextManager.getCurrentContext();
196
241
  if(ctx == null) { return; }
197
242
 
198
- ctx.footprint('Mongodb Command Start: '+command);
243
+ ctx.footprint('Mongodb Command Start: '+command);
199
244
  var sql_step;
200
245
  try{
201
246
  sql_step = new SqlStepX();
202
- var sql = 'mongodb ' + command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
247
+ var sql = command ;//+ ': ' + JSON.stringify(Object.keys(args[0]));
248
+ if(args[0]){
249
+ sql += ', where=' + JSON.stringify(Object.keys(args[0]));
250
+ }
203
251
  sql_step.hash = HashUtil.hashFromString(sql);
204
252
  sql_step.start_time = ctx.getElapsedTime();
205
253
  //sql_step.crud = 'D'.charCodeAt(0);
@@ -213,7 +261,7 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
213
261
 
214
262
  self.agent.aop.functionHook(args, -1, null, function (obj, args) {
215
263
  if(TraceContextManager.resume(ctx._id) == null || sql_step == null) { return; }
216
-
264
+
217
265
  ctx.footprint('Mongodb Command Done: '+command);
218
266
 
219
267
  if(args[0] != null) {
@@ -231,14 +279,15 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
231
279
  var ctx = TraceContextManager.getCurrentContext();
232
280
  if(ctx == null) { return; }
233
281
 
234
- ctx.footprint('Mongodb Command Start: '+command);
282
+ ctx.footprint('Mongodb Command Start: '+command);
235
283
  var sql_step;
236
284
  try{
285
+
237
286
  sql_step = new SqlStepX();
238
287
  var sql = 'mongodb ' + command ;//+ ': where=' + JSON.stringify(Object.keys(args[0]));
239
288
  sql_step.hash = HashUtil.hashFromString(sql);
240
289
  sql_step.start_time = ctx.getElapsedTime();
241
- // sql_step.crud = 'S'.charCodeAt(0);
290
+ // sql_step.crud = 'S'.charCodeAt(0);
242
291
  DataTextAgent.SQL.add(sql_step.hash, sql);
243
292
  ctx.profile.push(sql_step);
244
293
  } catch(e) {
@@ -248,7 +297,7 @@ MongoObserver.prototype.inject = function( mod, moduleName ) {
248
297
 
249
298
  self.agent.aop.functionHook(args, -1, null, function (obj, args) {
250
299
  if(TraceContextManager.resume(ctx._id) == null || sql_step == null) { return; }
251
-
300
+
252
301
  ctx.footprint('Mongodb Command Done: '+command);
253
302
 
254
303
  if(args[0] != null) {
@@ -21,6 +21,7 @@ var TraceContextManager = require('../trace/trace-context-manager'),
21
21
  conf = require('../conf/configure'),
22
22
  Logger = require('../logger');
23
23
  const DateUtil = require('../util/dateutil');
24
+ const MessageStep = require("../step/message-step");
24
25
 
25
26
  var MssqlObserver = function (agent) {
26
27
  this.agent = agent;
@@ -32,15 +33,15 @@ MssqlObserver.prototype.inject = function (mod, modName) {
32
33
 
33
34
  if(mod.__whatap_observe__) {return;}
34
35
  mod.__whatap_observe__ = true;
35
-
36
+
36
37
  Logger.initPrint("MssqlObserver");
37
38
 
38
39
  var self = this;
39
40
 
40
- var requestCommand = ['batch', 'bulk', 'query', 'execute'];
41
+ var requestCommand = ['_bulk', '_query', '_execute'];
41
42
 
42
43
  requestCommand.forEach(function (command) {
43
- self.aop.before(mod.Request.prototype, command,
44
+ self.aop.both(mod.Request.prototype, command,
44
45
  function (obj, args) {
45
46
 
46
47
  var ctx = TraceContextManager.getCurrentContext();
@@ -87,6 +88,21 @@ MssqlObserver.prototype.inject = function (mod, modName) {
87
88
  self.aop.functionHook(args, -1, function (obj, args) {
88
89
  TraceContextManager.resume(ctx);
89
90
  if(args[0] != null) {
91
+ if (conf.trace_sql_error_stack && conf.trace_sql_error_depth) {
92
+ var traceDepth = conf.trace_sql_error_depth;
93
+
94
+ var errorStack = args[0].stack.split("\n");
95
+ if (errorStack.length > traceDepth) {
96
+ errorStack = errorStack.slice(0, traceDepth + 1);
97
+ }
98
+ var errorStackString = errorStack.join("\n");
99
+ var error_stack_step = new MessageStep();
100
+ error_stack_step.hash = HashUtil.hashFromString("ERROR STACK");
101
+ error_stack_step.start_time = ctx.getElapsedTime();
102
+ error_stack_step.desc = errorStackString;
103
+ DataTextAgent.MESSAGE.add(error_stack_step.hash, "ERROR STACK");
104
+ ctx.profile.push(error_stack_step);
105
+ }
90
106
  if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
91
107
  sql_step.error = StatError.addError( 'mssql-'+args[0].code, args[0].message|| 'mssql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
92
108
  if (ctx.error.isZero()) { ctx.error = sql_step.error; }
@@ -102,7 +118,7 @@ MssqlObserver.prototype.inject = function (mod, modName) {
102
118
  sql_step.elapsed = ctx.getElapsedTime() - sql_step.start_time;
103
119
 
104
120
  MeterSql.add(dbc_hash, sql_step.elapsed, args[0] != null);
105
- StatSql.addSqlTime(ctx.service_hash, sql_step.dbc,
121
+ StatSql.addSqlTime(ctx.service_hash, sql_step.dbc,
106
122
  sql_step.hash, sql_step.elapsed, args[0] != null, 0);
107
123
 
108
124
  if(psql && psql.type == 'S') {
@@ -120,6 +136,7 @@ MssqlObserver.prototype.inject = function (mod, modName) {
120
136
 
121
137
  }
122
138
  });
139
+ }, function (obj, args, ret, lctx) {
123
140
  });
124
141
  });
125
142
  var conn_dbc_hash=0;
@@ -22,7 +22,8 @@ var TraceContextManager = require('../trace/trace-context-manager'),
22
22
  Logger = require('../logger'),
23
23
  conf = require('../conf/configure'),
24
24
  DateUtil = require('../util/dateutil'),
25
- Buffer = require('buffer').Buffer;
25
+ Buffer = require('buffer').Buffer,
26
+ MessageStep = require("../step/message-step");
26
27
 
27
28
  var MysqlObserver = function (agent) {
28
29
  this.agent = agent;
@@ -107,6 +108,21 @@ var queryHook = function (dbc_hash, agent) {
107
108
 
108
109
  if (args[0]) {
109
110
  try {
111
+ if (conf.trace_sql_error_stack && conf.trace_sql_error_depth) {
112
+ var traceDepth = conf.trace_sql_error_depth;
113
+
114
+ var errorStack = args[0].stack.split("\n");
115
+ if (errorStack.length > traceDepth) {
116
+ errorStack = errorStack.slice(0, traceDepth + 1);
117
+ }
118
+ var errorStackString = errorStack.join("\n");
119
+ var error_stack_step = new MessageStep();
120
+ error_stack_step.hash = HashUtil.hashFromString("ERROR STACK");
121
+ error_stack_step.start_time = ctx.getElapsedTime();
122
+ error_stack_step.desc = errorStackString;
123
+ DataTextAgent.MESSAGE.add(error_stack_step.hash, "ERROR STACK");
124
+ ctx.profile.push(error_stack_step);
125
+ }
110
126
  if (conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0) {
111
127
  sql_step.error = StatError.addError('mysql-' + args[0].code, args[0].message || 'mysql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
112
128
  if (ctx.error.isZero()) {
@@ -21,8 +21,9 @@ var TraceContextManager = require('../trace/trace-context-manager'),
21
21
  ParamSecurity = require('../util/paramsecurity'),
22
22
  Logger = require('../logger'),
23
23
  conf = require('../conf/configure'),
24
- Buffer = require('buffer').Buffer;
25
- const DateUtil = require('../util/dateutil');
24
+ Buffer = require('buffer').Buffer,
25
+ DateUtil = require('../util/dateutil'),
26
+ MessageStep = require("../step/message-step");
26
27
 
27
28
  var PgSqlObserver = function (agent) {
28
29
  this.agent = agent;
@@ -37,7 +38,7 @@ var queryHook = function (dbc_local, agent) {
37
38
 
38
39
  if (ctx == null || args[0] == null) { return; }
39
40
  if(args[0].sql == null && typeof args[0] != 'string') { return; }
40
-
41
+
41
42
  var sql_step = new SqlStepX();
42
43
  sql_step.start_time = ctx.getElapsedTime();
43
44
  ctx.profile.push(sql_step);
@@ -71,7 +72,7 @@ var queryHook = function (dbc_local, agent) {
71
72
 
72
73
  var els = new EscapeLiteralSQL(sql);
73
74
  els.process();
74
-
75
+
75
76
  ctx.active_sqlhash = sql_step.hash;
76
77
  ctx.active_dbc = sql_step.dbc;
77
78
  //ctx.active_crud = sql_step.crud;
@@ -102,6 +103,21 @@ var queryHook = function (dbc_local, agent) {
102
103
 
103
104
  if (args[0]) {
104
105
  try {
106
+ if (conf.trace_sql_error_stack && conf.trace_sql_error_depth) {
107
+ var traceDepth = conf.trace_sql_error_depth;
108
+
109
+ var errorStack = args[0].stack.split("\n");
110
+ if (errorStack.length > traceDepth) {
111
+ errorStack = errorStack.slice(0, traceDepth + 1);
112
+ }
113
+ var errorStackString = errorStack.join("\n");
114
+ var error_stack_step = new MessageStep();
115
+ error_stack_step.hash = HashUtil.hashFromString("ERROR STACK");
116
+ error_stack_step.start_time = ctx.getElapsedTime();
117
+ error_stack_step.desc = errorStackString;
118
+ DataTextAgent.MESSAGE.add(error_stack_step.hash, "ERROR STACK");
119
+ ctx.profile.push(error_stack_step);
120
+ }
105
121
  if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
106
122
  sql_step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message|| 'pgsql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
107
123
  if (ctx.error.isZero()) { ctx.error = sql_step.error; }
@@ -196,7 +212,7 @@ PgSqlObserver.prototype.inject = function (mod, moduleName) {
196
212
  mod.__whatap_observe__ = true;
197
213
 
198
214
  Logger.initPrint("PgSqlObserver");
199
-
215
+
200
216
  var self = this;
201
217
  var aop = self.agent.aop;
202
218
 
@@ -215,7 +231,7 @@ PgSqlObserver.prototype.inject = function (mod, moduleName) {
215
231
  dbc_step.start_time = ctx.getElapsedTime();
216
232
  lctx.step = dbc_step;
217
233
  },
218
-
234
+
219
235
  function (obj, args, ret, lctx) {
220
236
  var pool = ret;
221
237
  var ctx = lctx.context,
@@ -242,12 +258,12 @@ PgSqlObserver.prototype.inject = function (mod, moduleName) {
242
258
  ctx.db_opening = false;
243
259
 
244
260
  ctx.footprint('PgSql Connecting Done');
245
-
261
+
246
262
  ctx.profile.push(step);
247
-
263
+
248
264
  });
249
- aop.before(mod.Client.prototype, 'query', queryHook(dbc_hash, self.agent));
250
- aop.before(mod.Query.prototype, 'handleError', errorDelegate());
265
+ aop.before(mod.Client.prototype, 'query', queryHook(dbc_hash, self.agent));
266
+ aop.before(mod.Query.prototype, 'handleError', errorDelegate());
251
267
 
252
268
  };
253
269
 
@@ -263,7 +279,7 @@ function escapeLiteral(sql) {
263
279
  nonLiteSql.clear();
264
280
  date = DateUtil.yyyymmdd();
265
281
  Logger.print('WHATAP-SQL-CLEAR', 'PgSqlObserver CLEAR OK!!!!!!!!!!!!!!!!', false);
266
- }
282
+ }
267
283
 
268
284
  var sqlHash = HashUtil.hashFromString(sql);
269
285
  var psql = nonLiteSql.get(sqlHash);
@@ -36,6 +36,7 @@ function TxRecord() {
36
36
 
37
37
  this.mtid = Long.ZERO;
38
38
  this.mdepth = 0;
39
+ this.mcaller = Long.ZERO;
39
40
  this.mcaller_txid = Long.ZERO;
40
41
 
41
42
  this.mcaller_pcode = 0;
@@ -56,11 +57,13 @@ function TxRecord() {
56
57
  this.oid=0;
57
58
  this.okind=0;
58
59
  this.onode=0;
59
- /*
60
- this.custid = null;
60
+
61
+ this.custid=null;
61
62
  this.dbcTime=0;
62
- this.apdex;
63
- */
63
+ this.apdex=0;
64
+
65
+ this.mcallerStepId = Long.ZERO;
66
+ this.originUrl = null;
64
67
  }
65
68
  TxRecord.prototype.getServiceType = function() {return 0;};
66
69
 
@@ -98,7 +101,7 @@ TxRecord.prototype.write = function(dout) {
98
101
  o.writeByte(1);
99
102
  o.writeDecimal(this.mtid);
100
103
  o.writeDecimal(this.mdepth);
101
- o.writeDecimal(this.mcaller_txid);
104
+ o.writeDecimal(this.mcaller);
102
105
  }else{
103
106
  o.writeByte(0);
104
107
  }
@@ -135,16 +138,13 @@ TxRecord.prototype.write = function(dout) {
135
138
  o.writeDecimal(this.okind);
136
139
  o.writeDecimal(this.onode);
137
140
 
138
- /*
139
- // 2019.04.04
140
141
  o.writeText(this.custid);
141
-
142
- // 2019.07.09
143
142
  o.writeDecimal(this.dbcTime);
144
-
145
- //2021.05.13
146
143
  o.writeByte(this.apdex);
147
- */
144
+
145
+ o.writeDecimal(this.mcallerStepId);
146
+ o.writeText(this.originUrl);
147
+
148
148
  ////////////// BLOB ///////////////
149
149
  dout.writeBlob(o.toByteArray());
150
150
  };
@@ -250,7 +250,7 @@ TxRecord.prototype.read = function(din) {
250
250
  this.okind = i.readDecNumber();
251
251
  this.onode = i.readDecNumber();
252
252
  }
253
- /*
253
+
254
254
  if (i.available() > 0) {
255
255
  this.custid = i.readText();
256
256
  }
@@ -260,7 +260,12 @@ TxRecord.prototype.read = function(din) {
260
260
  if (i.available() > 0) {
261
261
  this.apdex = i.readByte();
262
262
  }
263
- */
263
+
264
+ if(i.available()>0) {
265
+ this.mcallerStepId=i.readDecNumber();
266
+ this.originUrl=i.readText();
267
+ }
268
+
264
269
  return this;
265
270
  };
266
271
 
@@ -9,12 +9,14 @@ var IntKeyMap = require('../util/intkey-map'),
9
9
  TraceContext = require('./trace-context'),
10
10
  Logger = require('../logger'),
11
11
  EventLevel = require('../data/event-level');
12
- Long = require('long');
12
+ Long = require('long');
13
+ var { AsyncLocalStorage } = require('async_hooks');
13
14
 
14
15
  function TraceContextManager() {
15
16
  this.initialized = false;
16
17
  this.nextId = 1;
17
18
  this.currentId = null;
19
+ this._asyncLocalStorage = new AsyncLocalStorage();
18
20
  this.entry = new IntKeyMap(1021,1).setMax(5000);
19
21
  }
20
22
 
@@ -28,10 +30,11 @@ TraceContextManager.prototype.size = function () {
28
30
  return this.entry.size();
29
31
  };
30
32
  TraceContextManager.prototype.getContext = function (key) {
31
- if(key == null ) {
32
- return null;
33
- }
34
- return this.entry.get(key);
33
+ // if(key == null ) {
34
+ // return null;
35
+ // }
36
+ // return this.entry.get(key);
37
+ return this._asyncLocalStorage.getStore();
35
38
  };
36
39
  TraceContextManager.prototype.getCurrentContext = function () {
37
40
  return this.getContext(this.currentId);
@@ -56,8 +59,9 @@ TraceContextManager.prototype.end = function (id) {
56
59
  this.currentId = null;
57
60
  } else {
58
61
  this.entry.remove(id);
59
- return;
62
+ // return;
60
63
  }
64
+ // this._asyncLocalStorage.disable();
61
65
  };
62
66
  TraceContextManager.prototype.getNextId = function () {
63
67
  this.nextId = (this.nextId + 1) % 10000000;
@@ -136,7 +140,7 @@ TraceContextManager.prototype.startTrace = function (title) {
136
140
  Logger.printError('WHATAP-998', 'TraceContext (startTrace)', e, true);
137
141
  }
138
142
  };
139
- TraceContextManager.prototype.endTrace = function (ctx) {
143
+ TraceContextManager.prototype.endTrace = function (ctx) {
140
144
  if(ctx == null) {return;}
141
145
  var ProfilePack = require('../pack/profile-pack'),
142
146
  TxRecord = require('../service/tx-record'),
@@ -170,7 +174,7 @@ TraceContextManager.prototype.startTrace = function (title) {
170
174
  if (ctx.error.isZero()==false/*long*/) {
171
175
  service.error = ctx.error;
172
176
  service.errorLevel = EventLevel.WARNING;
173
- }
177
+ }
174
178
  service.userAgent = ctx.userAgent;
175
179
  service.referer = ctx.referer;
176
180
 
@@ -97,6 +97,8 @@ function TraceContext(id) {
97
97
 
98
98
  this.last_footprint_time=Date.now();
99
99
  this.last_footprint_desc="start transaction";
100
+
101
+ this.mcaller_stepId = Long.ZERO;
100
102
  }
101
103
 
102
104
  TraceContext.prototype.footprint=function(desc){
@@ -0,0 +1,54 @@
1
+ 20231109 16:19:39 [WHATAP-001] <77103> Start initialize WhaTap Agent... Root[/Users/seunghunlee/workspace/nodejs_agent]
2
+ 20231109 16:19:39 [WHATAP-INIT] <77103> HttpObserver starting!
3
+ 20231109 16:19:39 [WHATAP-INIT] <77103> HttpObserver starting!
4
+ 20231109 16:19:39 [WHATAP-INIT] <77103> NetObserver starting!
5
+ 20231109 16:19:39 [WHTAP-loadObserves] <77103> unable to load mysql module
6
+ 20231109 16:19:39 [WHATAP-INIT] <77103> FileObserve starting!
7
+ 20231109 16:19:39 [WHATAP-203] <77103> Config file reloaded
8
+ 20231109 16:19:39 [WHATAP-101] <77103> Finish initialize configuration... false
9
+ 20231109 16:19:39 [WHATAP-110] <77103> [pcode=0,SECURE_KEY=]
10
+ 20231109 16:19:39 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
11
+ 20231109 16:19:44 [WHATAP-011] <77103> Connecton Retry....
12
+ Error: PCODE is not defined..
13
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
14
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
15
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
16
+ at listOnTimeout (node:internal/timers:559:17)
17
+ at processTimers (node:internal/timers:502:7)
18
+ 20231109 16:19:49 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
19
+ 20231109 16:19:54 [WHATAP-011] <77103> Connecton Retry....
20
+ Error: PCODE is not defined..
21
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
22
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
23
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
24
+ at listOnTimeout (node:internal/timers:559:17)
25
+ at processTimers (node:internal/timers:502:7)
26
+ 20231109 16:19:59 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
27
+ 20231109 16:20:04 [WHATAP-011] <77103> Connecton Retry....
28
+ Error: PCODE is not defined..
29
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
30
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
31
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
32
+ at listOnTimeout (node:internal/timers:559:17)
33
+ at processTimers (node:internal/timers:502:7)
34
+ 20231109 16:20:09 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
35
+ 20231109 16:20:14 [WHATAP-011] <77103> Connecton Retry....
36
+ Error: PCODE is not defined..
37
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
38
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
39
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
40
+ at listOnTimeout (node:internal/timers:559:17)
41
+ at processTimers (node:internal/timers:502:7)
42
+ 20231109 16:20:19 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
43
+ 20231109 16:20:24 [WHATAP-011] <77103> Connecton Retry....
44
+ Error: PCODE is not defined..
45
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
46
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
47
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
48
+ at listOnTimeout (node:internal/timers:559:17)
49
+ at processTimers (node:internal/timers:502:7)
50
+ 20231109 16:20:29 [WHATAP-171] <77103> [WhaTap Agent] Can not find server port.
51
+ Did you add requre('whatap') as the first line of the app's main module?
52
+ https://service.whatap.io/project/0/install
53
+ 20231109 16:20:29 [WHATAP-150] <77103> [WhaTap Agent] setLoopTime Up -> 30000
54
+ 20231109 16:20:29 [WHATAP-170] <77103> [WhaTap Agent] now waiting for starting......
@@ -0,0 +1,18 @@
1
+ 20231124 16:12:45 [WHATAP-001] <34410> Start initialize WhaTap Agent... Root[/Users/seunghunlee/workspace/nodejs_agent]
2
+ 20231124 16:12:45 [WHATAP-INIT] <34410> HttpObserver starting!
3
+ 20231124 16:12:45 [WHATAP-INIT] <34410> HttpObserver starting!
4
+ 20231124 16:12:45 [WHATAP-INIT] <34410> NetObserver starting!
5
+ 20231124 16:12:45 [WHTAP-loadObserves] <34410> unable to load mysql module
6
+ 20231124 16:12:45 [WHATAP-INIT] <34410> FileObserve starting!
7
+ 20231124 16:12:45 [WHATAP-203] <34410> Config file reloaded
8
+ 20231124 16:12:45 [WHATAP-101] <34410> Finish initialize configuration... false
9
+ 20231124 16:12:45 [WHATAP-110] <34410> [pcode=0,SECURE_KEY=]
10
+ 20231124 16:12:45 [WHATAP-170] <34410> [WhaTap Agent] now waiting for starting......
11
+ 20231124 16:12:50 [WHATAP-011] <34410> Connecton Retry....
12
+ Error: PCODE is not defined..
13
+ at TcpSession.open (/Users/seunghunlee/workspace/nodejs_agent/lib/net/tcp-session.js:41:26)
14
+ at Timeout.<anonymous> (/Users/seunghunlee/workspace/nodejs_agent/lib/core/agent.js:216:26)
15
+ at Timeout.wrapper [as _onTimeout] (/Users/seunghunlee/workspace/nodejs_agent/lib/core/interceptor.js:129:27)
16
+ at listOnTimeout (node:internal/timers:569:17)
17
+ at process.processTimers (node:internal/timers:512:7)
18
+ 20231124 16:12:55 [WHATAP-170] <34410> [WhaTap Agent] now waiting for starting......