whatap 0.4.67 → 0.4.69

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.
@@ -27,8 +27,8 @@ var ConfigDefault = {
27
27
  "profile_enabled": true,
28
28
  "sql_enabled": true,
29
29
  "httpc_enabled": true,
30
- "profile_max_time" : 300000,
31
- "profile_max_count" : 10000,
30
+ "profile_max_time" : num('profile_max_time',300000),
31
+ "profile_max_count" : num('profile_max_count',10000),
32
32
  "prepared_sql_max": 5001,
33
33
 
34
34
  "trace_service_name_header_key": null,
@@ -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', 'createPoolCluster'], function (obj, args, ret) {
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
- var all = obj._allConnections.length,
327
- idle = obj._freeConnections.length;
328
- MeterSql.setConnection((all - idle), idle, dbc);
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
  };
@@ -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
- this.container_id = line.substr(line.lastIndexOf('/')+1) || '';
21
- this.container_id = this.container_id.replace(/^(docker-)+|(containerd-)+|(crio-)+|(\\.scope)+$/ig, "");
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.67",
5
- "releaseDate": "20230307",
4
+ "version": "0.4.69",
5
+ "releaseDate": "20230315",
6
6
  "description": "Monitoring and Profiling Service",
7
7
  "main": "index.js",
8
8
  "scripts": {},