add CPU throttling metrics from cgroup cpu.stat#112
Draft
JayiceZ wants to merge 10 commits into
Draft
Conversation
JayiceZ
marked this pull request as draft
February 16, 2026 06:18
Contributor
There was a problem hiding this comment.
2 issues found across 1 file
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="process_metrics_linux.go">
<violation number="1" location="process_metrics_linux.go:474">
P2: writeProcessCpuThrottleMetrics dereferences ctms without guarding against the nil return from getCgroupCpuStats, which can panic when no cgroup CPU stats are available.</violation>
<violation number="2" location="process_metrics_linux.go:476">
P2: `process_cgroup_cpu_throttled_seconds_total` reports non-second units (micro/milliseconds). Convert throttled_time to seconds (or store microseconds consistently and divide by 1e6 when writing) to avoid unit mismatch.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #112 +/- ##
==========================================
- Coverage 87.96% 87.00% -0.96%
==========================================
Files 12 12
Lines 1437 1524 +87
==========================================
+ Hits 1264 1326 +62
- Misses 119 137 +18
- Partials 54 61 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JayiceZ
marked this pull request as ready for review
March 2, 2026 05:27
JayiceZ
marked this pull request as draft
March 2, 2026 09:36
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.
fix VictoriaMetrics/VictoriaMetrics#10430
Summary by cubic
Expose CPU throttling metrics from cgroup cpu.stat for the current process. Works with cgroup v1 and v2 and only emits metrics when the cgroup CPU controller is enabled (addresses #10430).
Written for commit 085d533. Summary will update on new commits.