whatap 0.4.66 → 0.4.68
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/core/agent.js
CHANGED
|
@@ -108,7 +108,7 @@ NodeAgent.prototype.init = function(cb) {
|
|
|
108
108
|
self.findRoot();
|
|
109
109
|
|
|
110
110
|
Logger.initializer.process();
|
|
111
|
-
Logger.print('WHATAP-001', 'Start initialize WhaTap Agent...', true);
|
|
111
|
+
Logger.print('WHATAP-001', 'Start initialize WhaTap Agent... Root[' + self._conf['app.root'] + ']', true);
|
|
112
112
|
|
|
113
113
|
if(self._conf['app.root'] == null || self._conf['app.root'].length == 0) {
|
|
114
114
|
return Logger.print("WHATAP-001", "Can not find application root directory", true);
|
|
@@ -279,8 +279,7 @@ MysqlObserver.prototype.inject = function (mod, moduleName) {
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
var dbc_pool_hash=0;
|
|
282
|
-
aop.after(mod, ['createPool'
|
|
283
|
-
|
|
282
|
+
aop.after(mod, ['createPool'], function (obj, args, ret) {
|
|
284
283
|
var dbc = 'mysql://';
|
|
285
284
|
if(dbc_pool_hash==0){
|
|
286
285
|
if(args.length > 0) {
|
|
@@ -322,10 +321,11 @@ MysqlObserver.prototype.inject = function (mod, moduleName) {
|
|
|
322
321
|
aop.before(conn._protocol, '_delegateError', errorDelegate(ctx));
|
|
323
322
|
});
|
|
324
323
|
}, function (obj, args, ret, lctx) {
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
324
|
+
if(obj._allConnections != undefined) {
|
|
325
|
+
var all = obj._allConnections.length;
|
|
326
|
+
var idle = obj._freeConnections.length;
|
|
327
|
+
MeterSql.setConnection((all - idle), idle, dbc);
|
|
328
|
+
}
|
|
329
329
|
});
|
|
330
330
|
});
|
|
331
331
|
};
|
package/lib/util/kube-util.js
CHANGED
|
@@ -17,8 +17,18 @@ var KubeUtil = {
|
|
|
17
17
|
for(var i = 0 ; i < contents.length ; i++){
|
|
18
18
|
var line = contents[i];
|
|
19
19
|
if(line){
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if(line.indexOf("/ecs/") >= 0) {
|
|
21
|
+
this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
22
|
+
} else{
|
|
23
|
+
//this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
24
|
+
//this.container_id = this.container_id.replace(/^(docker-)+|(cri-containerd-)+|(crio-)+|(\\.scope)+$/ig, "");
|
|
25
|
+
//container_id = container_id.replace(/^(docker-)+|(cri-)+|(cri-containerd-)+|(crio-)+|(.scope)+$/ig, "");
|
|
26
|
+
this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
|
|
27
|
+
this.container_id = this.container_id.replace(/^|(.scope)+$/ig, "");
|
|
28
|
+
this.container_id = this.container_id.substr(this.container_id.lastIndexOf('-')+1);
|
|
29
|
+
this.container_id = this.container_id.substr(this.container_id.lastIndexOf(':')+1);
|
|
30
|
+
}
|
|
31
|
+
|
|
22
32
|
if(this.container_id.length > 5){
|
|
23
33
|
this.container_key = HashUtil2.hash(this.container_id);
|
|
24
34
|
break;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whatap",
|
|
3
3
|
"homepage": "http://www.whatap.io",
|
|
4
|
-
"version": "0.4.
|
|
5
|
-
"releaseDate": "
|
|
4
|
+
"version": "0.4.68",
|
|
5
|
+
"releaseDate": "20230315",
|
|
6
6
|
"description": "Monitoring and Profiling Service",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {},
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"node": ">=v4.*"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"crypto": "
|
|
17
|
+
"crypto": "^1.0.1",
|
|
18
18
|
"df": "^1.1.1",
|
|
19
19
|
"long": "^3.2.0",
|
|
20
20
|
"pidusage": "^1.1.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"crypto": "
|
|
23
|
+
"crypto": "^1.0.1",
|
|
24
24
|
"df": "^1.1.1",
|
|
25
25
|
"long": "^3.2.0",
|
|
26
26
|
"pidusage": "^1.1.0"
|