songzhendong opened a new pull request, #142:
URL: https://github.com/apache/skywalking-nodejs/pull/142
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`.
- 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`.
- 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]