feat(runtime): add six instance_nodejs_* meters (6 -> 12) - #142
Closed
songzhendong wants to merge 1 commit into
Closed
feat(runtime): add six instance_nodejs_* meters (6 -> 12)#142songzhendong wants to merge 1 commit into
songzhendong wants to merge 1 commit into
Conversation
Report array_buffers, uptime, peak_malloced_memory, malloced_memory, old_space_used, and new_space_used alongside the existing six process meters. Replace detached_contexts with malloced_memory for reliable non-zero dashboard lines. Add CPU normalization unit test and document SW_AGENT_RUNTIME_METRICS_HEAP_SPACE_DETAIL. Signed-off-by: songzhendong <289505773@qq.com>
Contributor
Author
|
Closing temporarily for follow-up fixes before re-opening. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extend Node.js runtime metrics from 6 to 12
instance_nodejs_*meters reported viaMeterReportService.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
process.memoryUsage().arrayBuffersinstance_nodejs_array_buffersprocess.uptime()instance_nodejs_uptimev8.getHeapStatistics().peak_malloced_memoryinstance_nodejs_peak_malloced_memoryv8.getHeapStatistics().malloced_memoryinstance_nodejs_malloced_memoryv8.getHeapSpaceStatistics()old_spaceinstance_nodejs_old_space_usedv8.getHeapSpaceStatistics()new_spaceinstance_nodejs_new_space_used12 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(defaulttrue); whenfalse, skipgetHeapSpaceStatistics()and reportold_space_used/new_space_usedas0.process.cpuUsage()user + system, normalized by logical CPU count (0–100%).tests/runtime/RuntimeSampler.test.ts,tests/runtime/RuntimeMetricsCollector.test.ts.TestUnitRemotematrix on Node 20 / 22 / 24 (tests/remote,tests/config,tests/runtime).meterSize: 12, assertions for all twelve meters.