whatap 2.0.2 → 2.0.3-canary.0

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
@@ -90,24 +90,31 @@ NodeAgent.prototype.plugin=function(name,func){
90
90
  NodeAgent.prototype.findRoot = function () {
91
91
  var self = this;
92
92
  var root = process.cwd();
93
- while(root.length > 1) {
93
+ while(root && root.length >= 1) {
94
94
  var dir_name = path.join(root, 'package.json');
95
95
  if(fs.existsSync(dir_name)) {
96
96
  self._conf['app.root'] = root;
97
97
  return;
98
98
  }
99
- root = path.join(root, '..');
99
+ var parent = path.join(root, '..');
100
+ if(parent === root) break;
101
+ root = parent;
100
102
  }
101
103
 
102
- root = path.dirname(require.main.filename);
103
- while(root.length > 1) {
104
- var dir_name = path.join(root, 'package.json');
105
- if(fs.existsSync(dir_name)) {
106
- self._conf['app.root'] = root;
107
- return;
104
+ if(require.main && require.main.filename) {
105
+ root = path.dirname(require.main.filename);
106
+ while(root && root.length >= 1) {
107
+ var dir_name = path.join(root, 'package.json');
108
+ if(fs.existsSync(dir_name)) {
109
+ self._conf['app.root'] = root;
110
+ return;
111
+ }
112
+ var parent2 = path.join(root, '..');
113
+ if(parent2 === root) break;
114
+ root = parent2;
108
115
  }
109
- root = path.join(root, '..');
110
116
  }
117
+ // app.root을 못 찾으면 설정하지 않고 반환 → init()의 기존 폴백(WHATAP_HOME 우선)이 처리
111
118
  };
112
119
 
113
120
  // Cross-platform function to check if a process is running and is whatap_nodejs
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "whatap",
3
3
  "homepage": "http://www.whatap.io",
4
- "version": "2.0.2",
5
- "releaseDate": "20260612",
4
+ "version": "2.0.3-canary.0",
5
+ "releaseDate": "20260625",
6
6
  "description": "Monitoring and Profiling Service",
7
7
  "main": "index.js",
8
8
  "scripts": {},
@@ -1,77 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(grep -n \"ECONNREFUSED\" /Users/seunghunlee/agent_workspace/nodejs_agent/lib/observers/*.js /Users/seunghunlee/agent_workspace/nodejs_agent/lib/core/agent.js 2>/dev/null)",
5
- "WebSearch",
6
- "Bash(go env *)",
7
- "Bash(ls -l \"$\\(go env GOPATH\\)/bin/govulncheck\")",
8
- "Bash(brew list *)",
9
- "Bash(brew search *)",
10
- "Bash(brew info *)",
11
- "Bash(echo \"--- exit $? ---\")",
12
- "Bash(go version *)",
13
- "WebFetch(domain:github.com)",
14
- "Read(//Users/seunghunlee/workspace/**)",
15
- "Read(//Users/seunghunlee/workspace/nodejs_docker_sample/**)",
16
- "Bash(npm i *)",
17
- "Bash(chmod +x /Users/seunghunlee/workspace/nodejs_docker_sample/repro.sh)",
18
- "Bash(docker exec 273976be9e71 *)",
19
- "Bash(docker rm *)",
20
- "Bash(docker build *)",
21
- "Bash(docker run *)",
22
- "Bash(docker exec zombie-test *)",
23
- "Bash(curl -s http://localhost:3000/)",
24
- "Bash(curl -s http://localhost:3000/health)",
25
- "Bash(curl -s http://localhost:3000/slow)",
26
- "Bash(curl -s -o /dev/null -w \"status: %{http_code}\\\\n\" http://localhost:3000/error)",
27
- "Bash(curl -s -o /dev/null -w \"%{http_code} \" http://localhost:3000/)",
28
- "Bash(/usr/local/bin/docker exec *)",
29
- "Bash(/usr/local/bin/docker build *)",
30
- "Bash(/usr/local/bin/docker rm *)",
31
- "Bash(/usr/local/bin/docker run *)",
32
- "Bash(/bin/sleep 30)",
33
- "Bash(echo \"[$\\(date +%T\\)] zombies=$\\(/usr/local/bin/docker exec zombie-test sh -c \"ps -eo stat | awk '\\\\$1 ~ /^Z/' | wc -l\"\\)\")",
34
- "Bash(/bin/sleep 5)",
35
- "Bash(/usr/local/bin/docker ps *)",
36
- "Bash(/bin/sleep 6)",
37
- "Bash(/usr/local/bin/docker logs *)",
38
- "Bash(/usr/bin/curl -s http://localhost:3000/)",
39
- "Bash(/usr/bin/curl -s http://localhost:3000/health)",
40
- "Bash(/bin/sleep 7)",
41
- "Bash(cat agent/index.js)",
42
- "Bash(cat agent/writer.js)",
43
- "Bash(node -e \"const d=require\\('./config/defaults.js'\\); console.log\\('flushInterval=', d.flushInterval\\)\")",
44
- "Bash(cd *)",
45
- "Bash(ls /Users/seunghunlee/workspace/nodejs_docker_sample/node_modules/whatap/lib)",
46
- "Bash(ls /Users/seunghunlee/workspace/nodejs_docker_sample/node_modules/whatap/index.js)",
47
- "Bash(node -e ' *)",
48
- "Bash(export WHATAP_HOME=/tmp)",
49
- "Bash(node --expose-gc -e ' *)",
50
- "Bash(node -p \"process.platform+'/'+process.arch+' node '+process.version\")",
51
- "Read(//Users/seunghunlee/agent_workspace/apm-go-agent/**)",
52
- "Bash(node -e \"require\\('./lib/counter/task/metering-info'\\); console.log\\('module load OK'\\);\")",
53
- "Bash(node --check lib/counter/task/metering-info.js)",
54
- "Bash(node --check lib/util/cgroup-cpu.js)",
55
- "Bash(node -e \"var m=require\\('./index.js'\\); console.log\\('exports keys:', Object.keys\\(m\\)\\);\")",
56
- "Bash(docker version *)",
57
- "Bash(rm -rf whatap-local)",
58
- "Bash(rsync -a --exclude=.git --exclude=node_modules --exclude=logs --exclude=*.log /Users/seunghunlee/agent_workspace/nodejs_agent/ ./whatap-local/)",
59
- "Bash(node *)",
60
- "Bash(npm view *)",
61
- "Bash(rsync -a --delete --exclude=.git --exclude=node_modules --exclude=logs --exclude=*.log /Users/seunghunlee/agent_workspace/nodejs_agent/ ./whatap-local/)",
62
- "Bash(docker exec *)",
63
- "Bash(curl -s --max-time 5 http://localhost:3001/health)",
64
- "Bash(curl -s --max-time 5 http://localhost:3002/health)",
65
- "Bash(sed -n '66,71p' lib/counter/counter-manager.js)",
66
- "Bash(sed -n '166,168p' lib/conf/configure.js)",
67
- "Bash(sed -n '40,70p' lib/kube/kube-client.js)",
68
- "Bash(docker info *)",
69
- "Bash(« stray *)",
70
- "Bash(awk '{print $1}')",
71
- "Bash(xargs -r docker rm -f)",
72
- "Read(//Users/seunghunlee/agent_workspace/**)",
73
- "Bash(net_udp_packet_queue_size=500 node -e ' *)",
74
- "Bash(max_send_queue_size=500 node -e ' *)"
75
- ]
76
- }
77
- }