whatap 1.0.0 β 1.0.1-canary.1
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/README.md +77 -33
- package/lib/udp/udp_session.js +1 -1
- package/package.json +4 -3
- package/whatap.conf +4 -1
package/README.md
CHANGED
|
@@ -1,62 +1,106 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
2
|
+
# π WhaTap Node.js Agent
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
> **Comprehensive Node.js Application Performance Monitoring (APM) Solution**
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
WhaTap Node.js Agent provides real-time monitoring, tracing, and performance analysis capabilities as a professional APM agent.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## π Supported Environment
|
|
9
|
+
- **Platform**: macOS (64bit), Linux (64bit)
|
|
10
|
+
- **Node.js Version**: 17.0.0 or higher
|
|
11
|
+
- **Database**: MySQL, PostgreSQL, MSSQL, Oracle, MariaDB, MongoDB, Redis
|
|
12
|
+
- **Framework**: Express, Fastify, Socket.IO, WebSocket, GraphQL
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
You can install WhaTap using npm with the following command:
|
|
11
15
|
|
|
12
|
-
|
|
16
|
+
```bash
|
|
17
|
+
$ npm install whatap
|
|
18
|
+
```
|
|
13
19
|
|
|
14
|
-
#### Npm install
|
|
15
20
|
|
|
16
|
-
npm μμ λ€μκ³Ό κ°μ λͺ
λ Ήμ΄λ₯Ό ν΅ν΄ whatapμ μ€μΉ ν μ μμ΅λλ€.
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
## π Configuration
|
|
19
23
|
|
|
24
|
+
Copy the `whatap.conf` file from `node_modules/whatap` to your project root directory and configure it as follows:
|
|
20
25
|
|
|
26
|
+
```ini
|
|
27
|
+
# Essential Settings
|
|
28
|
+
license=XXXXXXXXXXXXXX-XXXXXXXXXXXXXX-XXXXXXXXXXXXXX
|
|
29
|
+
whatap.server.host=XXX.XXX.XXX.XXX
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
# Application Identification Settings
|
|
32
|
+
app_name=MyNodeApp # Application name
|
|
33
|
+
app_process_name=node # Process name
|
|
34
|
+
```
|
|
23
35
|
|
|
24
|
-
#### License Key
|
|
25
36
|
|
|
26
|
-
node\_modules/whatapμ μλ whatap.confνμΌμ λ£¨νΈ λλ ν λ¦¬λ‘ λ³΅μ¬ ν
|
|
27
|
-
λΌμ΄μΌμ€ ν€λ₯Ό λ°κΈλ°μ ν μΆκ° ν΄ μ£ΌμΈμ.
|
|
28
37
|
|
|
29
|
-
|
|
38
|
+
## π Usage
|
|
30
39
|
|
|
31
|
-
|
|
32
|
-
whatap.server.host=XXX.XXX.XXX.XXX
|
|
40
|
+
### Agent Initialization
|
|
33
41
|
|
|
42
|
+
To activate WhaTap monitoring in your Node.js application, add the WhaTap agent initialization code to your application's **top-level entry point file**.
|
|
34
43
|
|
|
44
|
+
> **β οΈ Important**: The WhaTap agent must be loaded before all other modules.
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
### Method 1: Using require('whatap') in Code
|
|
37
47
|
|
|
38
|
-
|
|
48
|
+
```javascript
|
|
49
|
+
// app.js (or server.js)
|
|
50
|
+
var WhatapAgent = require('whatap').NodeAgent;
|
|
39
51
|
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
// Import other modules after
|
|
53
|
+
const express = require('express');
|
|
54
|
+
const app = express();
|
|
42
55
|
|
|
43
|
-
|
|
56
|
+
// Application logic...
|
|
57
|
+
```
|
|
44
58
|
|
|
59
|
+
Run with:
|
|
60
|
+
```bash
|
|
61
|
+
node app.js
|
|
62
|
+
```
|
|
45
63
|
|
|
46
|
-
|
|
47
|
-
Whatap μμ΄μ νΈλ₯Ό CommonJS λ°©μμΌλ‘ κ°μ Έμ€κ³ μ΄κΈ°ννλ €λ©΄, λ€μ μ½λλ₯Ό μ ν리μΌμ΄μ
μ μ§μ
μ νμΌμ μΆκ°νμΈμ:
|
|
48
|
-
|
|
49
|
-
var WhatapAgent = require('whatap').NodeAgent;
|
|
64
|
+
### Method 2: Using -r flag (without code modification)
|
|
50
65
|
|
|
51
|
-
|
|
52
|
-
ESM λ°©μμΌλ‘ Whatap μμ΄μ νΈλ₯Ό κ°μ Έμ€κ³ μ¬μ©νλ €λ©΄, λ€μκ³Ό κ°μ΄ μ½λλ₯Ό μμ±νμΈμ:
|
|
66
|
+
If you prefer not to modify your application code, you can use the `-r` flag:
|
|
53
67
|
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
```bash
|
|
69
|
+
node -r whatap app.js
|
|
70
|
+
```
|
|
56
71
|
|
|
57
|
-
|
|
72
|
+
### ECMAScript Module (ESM) System
|
|
58
73
|
|
|
59
|
-
|
|
74
|
+
```javascript
|
|
75
|
+
// app.js (or server.js)
|
|
76
|
+
import WhatapAgent from 'whatap';
|
|
77
|
+
WhatapAgent.NodeAgent;
|
|
78
|
+
|
|
79
|
+
// Import other modules after
|
|
80
|
+
import express from 'express';
|
|
81
|
+
const app = express();
|
|
82
|
+
|
|
83
|
+
// Application logic...
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## β
Run Application
|
|
87
|
+
|
|
88
|
+
Once the agent configuration is complete, restart your application to begin monitoring:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Direct Node.js execution
|
|
92
|
+
node app.js
|
|
93
|
+
|
|
94
|
+
# Using npm scripts
|
|
95
|
+
npm start
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Monitoring Dashboard
|
|
99
|
+
|
|
100
|
+
Once your application is running, you can view the following information in the WhaTap console:
|
|
101
|
+
|
|
102
|
+
- π **Real-time Transactions**: HTTP requests, database query tracking
|
|
103
|
+
- π **Performance Metrics**: CPU, memory, GC information
|
|
104
|
+
- π¨ **Error Monitoring**: Application error and exception tracking
|
|
105
|
+
- π **Statistical Analysis**: Response time and throughput statistics
|
|
60
106
|
|
|
61
|
-
μ΄ν리μΌμ΄μ
μλ²κ° μ€νλλ©΄ μ ν리μΌμ΄μ
μ λͺ¨λν°λ§ μ 보λ₯Ό μμ§νκΈ°
|
|
62
|
-
μμν©λλ€.
|
package/lib/udp/udp_session.js
CHANGED
|
@@ -60,7 +60,7 @@ class UdpSession {
|
|
|
60
60
|
self.serverHost = conf.net_udp_host || PacketEnum.SERVER;
|
|
61
61
|
self.serverPort = parseInt(conf.net_udp_port || PacketEnum.PORT);
|
|
62
62
|
|
|
63
|
-
console.log(`UDP initialized with server ${self.serverHost}:${self.serverPort}`);
|
|
63
|
+
// console.log(`UDP initialized with server ${self.serverHost}:${self.serverPort}`);
|
|
64
64
|
|
|
65
65
|
// "connected UDP" λ‘ μ ν: lsofμμ peerκ° λ³΄μ΄λλ‘
|
|
66
66
|
self.socket.connect(self.serverPort, self.serverHost, () => {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "whatap",
|
|
3
3
|
"homepage": "http://www.whatap.io",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"releaseDate": "
|
|
4
|
+
"version": "1.0.1-canary.1",
|
|
5
|
+
"releaseDate": "20250924",
|
|
6
6
|
"description": "Monitoring and Profiling Service",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {},
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"long": "^3.2.0",
|
|
18
|
-
"proper-lockfile": "^4.1.2"
|
|
18
|
+
"proper-lockfile": "^4.1.2",
|
|
19
|
+
"uuid": "^11.1.0"
|
|
19
20
|
},
|
|
20
21
|
"devDependencies": {
|
|
21
22
|
"long": "^3.2.0"
|
package/whatap.conf
CHANGED