songzhendong opened a new pull request, #143:
URL: https://github.com/apache/skywalking-nodejs/pull/143

   Extend Node.js runtime metrics from **6 to 12** `instance_nodejs_*` meters 
reported via `MeterReportService.collect`, building on the six meters 
introduced in #139.
   
   This PR is **metrics-only** — no gRPC/TLS/DNS/CommandService changes.
   
   ### Motivation
   
    Operators need richer Node.js process/V8 visibility (array buffers, uptime, 
malloc stats, heap generations) alongside the existing CPU/heap/RSS meters.
   
   
   ### Changes
   
   #### Six additional meters
   
   | Node.js source | Meter name | Unit |
   | :--- | :--- | :--- |
   | `process.memoryUsage().arrayBuffers` | `instance_nodejs_array_buffers` | 
bytes |
   | `process.uptime()` | `instance_nodejs_uptime` | seconds |
   | `v8.getHeapStatistics().peak_malloced_memory` | 
`instance_nodejs_peak_malloced_memory` | bytes |
   | `v8.getHeapStatistics().malloced_memory` | 
`instance_nodejs_malloced_memory` | bytes |
   | `v8.getHeapSpaceStatistics()` old_space | `instance_nodejs_old_space_used` 
| bytes |
   | `v8.getHeapSpaceStatistics()` new_space | `instance_nodejs_new_space_used` 
| bytes |
   
   **12 total** with the six baseline meters: `process_cpu`, `heap_used`, 
`heap_total`, `heap_limit`, `rss`, `external_memory`.
   
   #### Other
   
   - `SW_AGENT_RUNTIME_METRICS_HEAP_SPACE_DETAIL` (default `true`); when 
`false`, skip `getHeapSpaceStatistics()` and report `old_space_used` / 
`new_space_used` as `0`.
   - `SW_AGENT_RUNTIME_METRICS_MAX_SNAPSHOTS_PER_REPORT` (default `1`); drain 
at most one buffered snapshot per report tick (limits meter stream burst after 
reconnect).
   - `MeterSender`: use per-snapshot `collectedAt` for `setTimestamp()` instead 
of a single batch `Date.now()`.
   - Process CPU: `process.cpuUsage()` user + system, normalized by **logical 
CPU count** (0–100%).
   - README: twelve-meter table + env documentation.
   - Unit tests: `tests/runtime/RuntimeSampler.test.ts`, 
`tests/runtime/RuntimeMetricsCollector.test.ts`, 
`tests/remote/MeterSender.test.ts`.
   - CI: `TestUnitRemote` matrix on Node **20 / 22 / 24** (`tests/remote`, 
`tests/config`, `tests/runtime`).
   - Express plugin e2e: `meterSize: 12`, assertions for all twelve meters.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to