whatap 0.5.19 → 0.5.21

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.
@@ -63,9 +63,11 @@ var errorDelegate = function (ctx, step) {
63
63
  MeterSql.add(step.dbc, step.elapsed, true);
64
64
  StatSql.addSqlTime(ctx.service_hash, step.dbc, step.hash, step.elapsed, true, 0);
65
65
 
66
+ ctx.error_class = args[0].name || args[0].constructor?.name || 'OracleError';
67
+
66
68
  try {
67
69
  var errorCode = args[0].errorNum || args[0].code || 'ORA-00000';
68
- var errorMsg = args[0].message || 'Oracle error';
70
+ var errorMsg = ctx.error_message = args[0].message || 'Oracle error';
69
71
 
70
72
  if (conf._is_trace_ignore_err_cls_contains === true && errorCode.toString().indexOf(conf.trace_ignore_err_cls_contains) < 0) {
71
73
  step.error = StatError.addError('oracle-' + errorCode, errorMsg, ctx.service_hash, TextTypes.SQL, step.hash);
@@ -96,6 +98,7 @@ var errorDelegate = function (ctx, step) {
96
98
  }
97
99
  } catch (e) {
98
100
  Logger.printError('WHATAP-110', 'OracleObserver error delegate exception', e, false);
101
+ ctx.error_message = 'Oracle error processing failed';
99
102
  }
100
103
  };
101
104
  };
@@ -239,6 +239,8 @@ PgSqlObserver.prototype._finishQuery = function (ctx, sql_step) {
239
239
  };
240
240
 
241
241
  PgSqlObserver.prototype._handleError = function (ctx, sql_step, err) {
242
+ ctx.error_message = err.message;
243
+ ctx.error_class = err.name || err.constructor?.name || 'PgsqlError';
242
244
  sql_step.elapsed = ctx.getElapsedTime() - sql_step.start_time;
243
245
  TraceSQL.isSlowSQL(ctx);
244
246
 
@@ -237,7 +237,6 @@ PrismaObserver.prototype.hookUseMiddleware = function(prismaInstance) {
237
237
  }
238
238
  }
239
239
  try {
240
-
241
240
  result = await next(params);
242
241
 
243
242
  // Raw 쿼리 처리
@@ -353,7 +352,9 @@ PrismaObserver.prototype._handleError = function(ctx, sql_step, err) {
353
352
  StatSql.addSqlTime(ctx.service_hash, sql_step.dbc, sql_step.hash, sql_step.elapsed, true, 0);
354
353
 
355
354
  try {
356
- const errorClassName = err.name || (err.constructor && err.constructor.name) || "UnknownError";
355
+ const errorClassName = err.name || err.constructor?.name || "UnknownError";
356
+ ctx.error_class = errorClassName;
357
+ ctx.error_message = err.message;
357
358
  sql_step.error = StatError.addError(errorClassName, err.message, ctx.service_hash, TextTypes.SQL, sql_step.hash);
358
359
 
359
360
  if (ctx.error.isZero()) {
@@ -43,27 +43,37 @@ function TxRecord() {
43
43
  this.mcaller_okind = 0;
44
44
  this.mcaller_oid = 0;
45
45
  this.mcaller_spec = 0;
46
- this.mcaller_url = 0;
46
+ this.mcaller_url = 0;
47
47
  this.mthis_spec = 0;
48
-
48
+
49
49
  this.http_method = 0;
50
50
 
51
51
  this.domain = 0;
52
52
  this.fields = [];
53
53
 
54
54
  this.login=0;
55
- this.errorLevel=0;
55
+ this.errorLevel=0;
56
56
 
57
- this.oid=0;
57
+ this.oid=0;
58
58
  this.okind=0;
59
- this.onode=0;
60
-
59
+ this.onode=0;
60
+
61
61
  this.custid=null;
62
62
  this.dbcTime=0;
63
63
  this.apdex=0;
64
64
 
65
65
  this.mcallerStepId = Long.ZERO;
66
- this.originUrl = null;
66
+ this.originUrl = null;
67
+
68
+ this.step_split_count = 0;
69
+
70
+ this.methodCount = 0;
71
+ this.methodTime = 0;
72
+
73
+ this.appctx = "";
74
+ this.txName = "";
75
+ this.error_class = "";
76
+ this.error_message = "";
67
77
  }
68
78
  TxRecord.prototype.getServiceType = function() {return 0;};
69
79
 
@@ -78,15 +88,15 @@ TxRecord.prototype.write = function(dout) {
78
88
  o.writeDecimal(this.error);
79
89
  o.writeDecimal(this.cpuTime);
80
90
  o.writeDecimal(this.malloc);
81
-
91
+
82
92
  o.writeDecimal(this.sqlCount);
83
93
  o.writeDecimal(this.sqlTime);
84
94
  o.writeDecimal(this.sqlFetchCount);
85
95
  o.writeDecimal(this.sqlFetchTime);
86
-
96
+
87
97
  o.writeDecimal(this.httpcCount);
88
98
  o.writeDecimal(this.httpcTime);
89
-
99
+
90
100
  o.writeBoolean(this.active);
91
101
  o.writeDecimal(this.steps_data_pos);
92
102
  o.writeDecimal(this.cipher);
@@ -113,13 +123,13 @@ TxRecord.prototype.write = function(dout) {
113
123
  o.writeDecimal(this.mcaller_spec);
114
124
  o.writeDecimal(this.mcaller_url);
115
125
  o.writeDecimal(this.mthis_spec);//보통 0, 서버에서 셋팅
116
- }else {
126
+ }else {
117
127
  o.writeByte(0);
118
- }
128
+ }
119
129
 
120
130
  o.writeByte(this.http_method);
121
131
  o.writeDecimal(this.domain);
122
-
132
+
123
133
  if (this.fields == null || this.fields.length==0) {
124
134
  o.writeByte(0);
125
135
  } else {
@@ -137,7 +147,7 @@ TxRecord.prototype.write = function(dout) {
137
147
  o.writeDecimal(this.oid);
138
148
  o.writeDecimal(this.okind);
139
149
  o.writeDecimal(this.onode);
140
-
150
+
141
151
  o.writeText(this.custid);
142
152
  o.writeDecimal(this.dbcTime);
143
153
  o.writeByte(this.apdex);
@@ -145,6 +155,16 @@ TxRecord.prototype.write = function(dout) {
145
155
  o.writeDecimal(this.mcallerStepId);
146
156
  o.writeText(this.originUrl);
147
157
 
158
+ o.writeDecimal(this.step_split_count);
159
+
160
+ o.writeDecimal(this.methodCount);
161
+ o.writeDecimal(this.methodTime);
162
+
163
+ o.writeText(this.appctx);
164
+ o.writeText(this.txName);
165
+ o.writeText(this.error_class);
166
+ o.writeText(this.error_message);
167
+
148
168
  ////////////// BLOB ///////////////
149
169
  dout.writeBlob(o.toByteArray());
150
170
  };
@@ -160,18 +180,18 @@ TxRecord.prototype.read = function(din) {
160
180
  this.service = i.readDecNumber();
161
181
  this.elapsed = i.readDecNumber();
162
182
  this.error = i.readDecimal();
163
-
183
+
164
184
  this.cpuTime = i.readDecNumber();
165
185
  this.malloc = i.readDecNumber();
166
-
186
+
167
187
  this.sqlCount = i.readDecNumber();
168
188
  this.sqlTime = i.readDecNumber();
169
189
  this.sqlFetchCount = i.readDecNumber();
170
190
  this.sqlFetchTime = i.readDecNumber();
171
-
191
+
172
192
  this.httpcCount = i.readDecNumber();
173
193
  this.httpcTime = i.readDecNumber();
174
-
194
+
175
195
  this.active = i.readBoolean();
176
196
  this.steps_data_pos = i.readDecNumber();
177
197
  this.cipher = i.readDecNumber();
@@ -187,41 +207,41 @@ TxRecord.prototype.read = function(din) {
187
207
  this.mdepth = i.readDecNumber();
188
208
  this.mcaller_txid = i.readDecLong();
189
209
  }
190
-
210
+
191
211
  switch (i.readByte()) {
192
- case 1:
193
- this.mcaller_pcode = i.readDecNumber();
194
- break;
195
- case 3:
196
- this.mcaller_pcode = i.readDecNumber();
197
- this.mcaller_spec = i.readDecNumber();
198
- this.mcaller_url = i.readDecNumber();
199
- break;
200
- case 4:
201
- this.mcaller_pcode = i.readDecNumber();
202
- this.mcaller_spec = i.readDecNumber();
203
- this.mcaller_url = i.readDecNumber();
204
- this.mthis_spec = i.readDecNumber();
205
- break;
206
- case 5:
207
- this.mcaller_pcode = i.readDecNumber();
208
- this.mcaller_oid = i.readDecNumber();
209
- this.mcaller_spec = i.readDecNumber();
210
- this.mcaller_url = i.readDecNumber();
211
- this.mthis_spec = i.readDecNumber();
212
- break;
213
- case 6:
214
- this.mcaller_pcode = i.readDecNumber();
215
- this.mcaller_okind = i.readDecNumber();
216
- this.mcaller_oid = i.readDecNumber();
217
- this.mcaller_spec = i.readDecNumber();
218
- this.mcaller_url = i.readDecNumber();
219
- this.mthis_spec = i.readDecNumber();
220
- break;
221
- }
212
+ case 1:
213
+ this.mcaller_pcode = i.readDecNumber();
214
+ break;
215
+ case 3:
216
+ this.mcaller_pcode = i.readDecNumber();
217
+ this.mcaller_spec = i.readDecNumber();
218
+ this.mcaller_url = i.readDecNumber();
219
+ break;
220
+ case 4:
221
+ this.mcaller_pcode = i.readDecNumber();
222
+ this.mcaller_spec = i.readDecNumber();
223
+ this.mcaller_url = i.readDecNumber();
224
+ this.mthis_spec = i.readDecNumber();
225
+ break;
226
+ case 5:
227
+ this.mcaller_pcode = i.readDecNumber();
228
+ this.mcaller_oid = i.readDecNumber();
229
+ this.mcaller_spec = i.readDecNumber();
230
+ this.mcaller_url = i.readDecNumber();
231
+ this.mthis_spec = i.readDecNumber();
232
+ break;
233
+ case 6:
234
+ this.mcaller_pcode = i.readDecNumber();
235
+ this.mcaller_okind = i.readDecNumber();
236
+ this.mcaller_oid = i.readDecNumber();
237
+ this.mcaller_spec = i.readDecNumber();
238
+ this.mcaller_url = i.readDecNumber();
239
+ this.mthis_spec = i.readDecNumber();
240
+ break;
241
+ }
222
242
  this.http_method = i.readByte();
223
243
  this.domain = i.readDecNumber();
224
-
244
+
225
245
  var n = i.readByte();
226
246
  if (n > 0) {
227
247
  this.fields = new Array(n);
@@ -250,7 +270,7 @@ TxRecord.prototype.read = function(din) {
250
270
  this.okind = i.readDecNumber();
251
271
  this.onode = i.readDecNumber();
252
272
  }
253
-
273
+
254
274
  if (i.available() > 0) {
255
275
  this.custid = i.readText();
256
276
  }
@@ -260,11 +280,29 @@ TxRecord.prototype.read = function(din) {
260
280
  if (i.available() > 0) {
261
281
  this.apdex = i.readByte();
262
282
  }
263
-
283
+
264
284
  if(i.available()>0) {
265
285
  this.mcallerStepId=i.readDecNumber();
266
286
  this.originUrl=i.readText();
267
- }
287
+ }
288
+
289
+ if (i.available() > 0) {
290
+ this.step_split_count = i.readDecimal();
291
+ }
292
+ if (i.available() > 0) {
293
+ this.methodCount = i.readDecimal();
294
+ this.methodTime = i.readDecimal();
295
+ }
296
+ if(i.available()>0) {
297
+ this.appctx=i.readText();
298
+ }
299
+ if(i.available()>0) {
300
+ this.txName=i.readText();
301
+ }
302
+ if(i.available()>0) {
303
+ this.error_class = i.readText();
304
+ this.error_message = i.readText();
305
+ }
268
306
 
269
307
  return this;
270
308
  };
@@ -276,7 +314,7 @@ TxRecord.prototype.toBytes = function() {
276
314
  };
277
315
 
278
316
  TxRecord.prototype.toObject = function(b) {
279
- var din = new DataInputX(b);
317
+ var din = new DataInputX(b);
280
318
  this.read(din);
281
319
  return service;
282
320
  };
@@ -31,6 +31,8 @@ function TraceContext(id) {
31
31
  this.service_name = '';
32
32
  this.remoteIp = 0;
33
33
  this.error = Long.ZERO;
34
+ this.error_class = '';
35
+ this.error_message = '';
34
36
 
35
37
  this.http_method = '';
36
38
  this.http_query = '';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "whatap",
3
3
  "homepage": "http://www.whatap.io",
4
- "version": "0.5.19",
5
- "releaseDate": "20250514",
4
+ "version": "0.5.21",
5
+ "releaseDate": "20250626",
6
6
  "description": "Monitoring and Profiling Service",
7
7
  "main": "index.js",
8
8
  "scripts": {},