whatap 0.4.69 → 0.4.71
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/lib/conf/config-default.js +5 -0
- package/lib/conf/configure.js +17 -0
- package/lib/core/agent.js +2 -5
- package/lib/observers/maria-observer.js +21 -10
- package/lib/observers/mssql-observer.js +9 -9
- package/lib/observers/mysql-observer.js +23 -3
- package/lib/observers/pgsql-observer.js +20 -11
- package/package.json +2 -2
|
@@ -162,6 +162,11 @@ var ConfigDefault = {
|
|
|
162
162
|
"trace_ignore_url_prefix": str('trace_ignore_url_prefix',''),
|
|
163
163
|
"_is_trace_ignore_url_prefix": false,
|
|
164
164
|
|
|
165
|
+
"trace_ignore_err_cls_contains": str('trace_ignore_err_cls_contains',''),
|
|
166
|
+
"_is_trace_ignore_err_cls_contains": false,
|
|
167
|
+
"trace_ignore_err_msg_contains": str('trace_ignore_err_msg_contains',''),
|
|
168
|
+
"_is_trace_ignore_err_msg_contains": false,
|
|
169
|
+
|
|
165
170
|
"trace_origin_url": bool('trace_origin_url',false),
|
|
166
171
|
//2019.12.12 Kubernetes
|
|
167
172
|
"whatap_kubernetes_enabled": bool('whatap_kubernetes_enabled',false),
|
package/lib/conf/configure.js
CHANGED
|
@@ -395,6 +395,23 @@ conf.on('trace_ignore_url_prefix', function(props){
|
|
|
395
395
|
}
|
|
396
396
|
});
|
|
397
397
|
|
|
398
|
+
conf.on('trace_ignore_err_cls_contains', function(props){
|
|
399
|
+
if(props && props.constructor === String && props.length > 0 ){
|
|
400
|
+
conf._is_trace_ignore_err_cls_contains = true;
|
|
401
|
+
}else{
|
|
402
|
+
conf._is_trace_ignore_err_cls_contains = false;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
conf.on('trace_ignore_err_msg_contains', function(props){
|
|
407
|
+
if(props && props.constructor === String && props.length > 0 ){
|
|
408
|
+
conf._is_trace_ignore_err_msg_contains = true;
|
|
409
|
+
}else{
|
|
410
|
+
conf._is_trace_ignore_err_msg_contains = false;
|
|
411
|
+
}
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
|
|
398
415
|
conf.on('mtrace_spec', function(props){
|
|
399
416
|
if (!props || props.length == 0) {
|
|
400
417
|
conf.mtrace_spec_hash = 0;
|
package/lib/core/agent.js
CHANGED
|
@@ -241,11 +241,7 @@ NodeAgent.prototype.connectCB = function (cb) {
|
|
|
241
241
|
});
|
|
242
242
|
}, self.setLoopTime);
|
|
243
243
|
};
|
|
244
|
-
|
|
245
|
-
return new Promise(resolve=>{
|
|
246
|
-
setTimeout(resolve,ms)
|
|
247
|
-
})
|
|
248
|
-
}
|
|
244
|
+
|
|
249
245
|
NodeAgent.prototype.loadObserves = function() {
|
|
250
246
|
var agent = this;
|
|
251
247
|
var observes = [];
|
|
@@ -296,6 +292,7 @@ NodeAgent.prototype.loadObserves = function() {
|
|
|
296
292
|
new ProcessObserver(agent).inject(process, 'process');
|
|
297
293
|
new GlobalObserver(agent).inject(global, 'global');
|
|
298
294
|
};
|
|
295
|
+
|
|
299
296
|
NodeAgent.prototype.setServicePort = function (port) {
|
|
300
297
|
Configuration['whatap.port'] = port || 0;
|
|
301
298
|
}
|
|
@@ -101,14 +101,16 @@ var queryHook = function (dbc_hash, agent) {
|
|
|
101
101
|
|
|
102
102
|
if(args[0]) {
|
|
103
103
|
try{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
104
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
105
|
+
sql_step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
106
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
107
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
108
|
+
sql_step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
109
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
110
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
111
|
+
sql_step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
112
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
113
|
+
}
|
|
112
114
|
}catch(e) {
|
|
113
115
|
|
|
114
116
|
}
|
|
@@ -178,10 +180,19 @@ var errorDelegate = function () {
|
|
|
178
180
|
if(args[0].fatal) {
|
|
179
181
|
// Connection Error
|
|
180
182
|
step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message, ctx.service_hash); /*long*/
|
|
183
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
181
184
|
} else {
|
|
182
|
-
|
|
185
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
186
|
+
step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
187
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
188
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
189
|
+
step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
190
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
191
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
192
|
+
step.error = StatError.addError( 'Maria-'+args[0].code, args[0].message || 'Maria error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
193
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
194
|
+
}
|
|
183
195
|
}
|
|
184
|
-
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
185
196
|
} catch(e) {
|
|
186
197
|
}
|
|
187
198
|
}
|
|
@@ -85,15 +85,15 @@ MssqlObserver.prototype.inject = function (mod, modName) {
|
|
|
85
85
|
self.aop.functionHook(args, -1, function (obj, args) {
|
|
86
86
|
TraceContextManager.resume(ctx);
|
|
87
87
|
if(args[0] != null) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
TextTypes.SQL,
|
|
93
|
-
sql_step.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
ctx.error =
|
|
88
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
89
|
+
sql_step.error = StatError.addError( 'mssql-'+args[0].code, args[0].message|| 'mssql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
90
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
91
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
92
|
+
sql_step.error = StatError.addError( 'mssql-'+args[0].code, args[0].message|| 'mssql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
93
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
94
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
95
|
+
sql_step.error = StatError.addError( 'mssql-'+args[0].code, args[0].message|| 'mssql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
96
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -101,6 +101,17 @@ var queryHook = function (dbc_hash, agent) {
|
|
|
101
101
|
|
|
102
102
|
if(args[0]) {
|
|
103
103
|
try{
|
|
104
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0 ){
|
|
105
|
+
sql_step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message || 'mysql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
106
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
107
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0 ){
|
|
108
|
+
sql_step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message || 'mysql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
109
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
110
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
111
|
+
sql_step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message || 'mysql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
112
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
113
|
+
}
|
|
114
|
+
/*
|
|
104
115
|
sql_step.error = StatError.addError(
|
|
105
116
|
('mysql-'+args[0].code ),
|
|
106
117
|
(args[0].message || 'mysql error'),
|
|
@@ -109,6 +120,7 @@ var queryHook = function (dbc_hash, agent) {
|
|
|
109
120
|
if(ctx.error.isZero()) {
|
|
110
121
|
ctx.error = sql_step.error;
|
|
111
122
|
}
|
|
123
|
+
*/
|
|
112
124
|
}catch(e) {
|
|
113
125
|
|
|
114
126
|
}
|
|
@@ -176,12 +188,20 @@ var errorDelegate = function () {
|
|
|
176
188
|
|
|
177
189
|
try{
|
|
178
190
|
if(args[0].fatal) {
|
|
179
|
-
// Connection Error
|
|
180
191
|
step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message, ctx.service_hash); /*long*/
|
|
192
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
181
193
|
} else {
|
|
182
|
-
|
|
194
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
195
|
+
step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
196
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
197
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
198
|
+
step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
199
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
200
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
201
|
+
step.error = StatError.addError( 'mysql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
202
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
203
|
+
}
|
|
183
204
|
}
|
|
184
|
-
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
185
205
|
} catch(e) {
|
|
186
206
|
}
|
|
187
207
|
}
|
|
@@ -102,13 +102,15 @@ var queryHook = function (dbc_local, agent) {
|
|
|
102
102
|
|
|
103
103
|
if (args[0]) {
|
|
104
104
|
try {
|
|
105
|
-
|
|
106
|
-
(
|
|
107
|
-
(
|
|
108
|
-
|
|
109
|
-
TextTypes.SQL,
|
|
110
|
-
|
|
111
|
-
|
|
105
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
106
|
+
sql_step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message|| 'pgsql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
107
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
108
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
109
|
+
sql_step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message|| 'pgsql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
110
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
111
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
112
|
+
sql_step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message|| 'pgsql error', ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
113
|
+
if (ctx.error.isZero()) { ctx.error = sql_step.error; }
|
|
112
114
|
}
|
|
113
115
|
} catch (e) {
|
|
114
116
|
}
|
|
@@ -169,11 +171,18 @@ var errorDelegate = function () {
|
|
|
169
171
|
if(args[0].fatal) {
|
|
170
172
|
// Connection Error
|
|
171
173
|
step.error = StatError.addError("pgsql-"+args[0].code, args[0].message, ctx.service_hash); /*long*/
|
|
174
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
172
175
|
} else {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
176
|
+
if(conf._is_trace_ignore_err_cls_contains === true && args[0].code.indexOf(conf.trace_ignore_err_cls_contains) < 0){
|
|
177
|
+
step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
178
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
179
|
+
} else if(conf._is_trace_ignore_err_msg_contains === true && args[0].message.indexOf(conf.trace_ignore_err_msg_contains) < 0){
|
|
180
|
+
step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
181
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
182
|
+
} else if(conf._is_trace_ignore_err_cls_contains === false && conf._is_trace_ignore_err_msg_contains === false) {
|
|
183
|
+
step.error = StatError.addError( 'pgsql-'+args[0].code, args[0].message, ctx.service_hash, TextTypes.SQL, step.hash); /*long*/
|
|
184
|
+
if (ctx.error.isZero()) { ctx.error = step.error; }
|
|
185
|
+
}
|
|
177
186
|
}
|
|
178
187
|
} catch(e) {
|
|
179
188
|
Logger.printError('WHATAP-997', 'pgsql-observer (errorDelegate)', e, true);
|
package/package.json
CHANGED