Use gauges instead of counters for GC Pause Total and Num GCs#174
Closed
miguelmolina95 wants to merge 2 commits intomasterfrom
Closed
Use gauges instead of counters for GC Pause Total and Num GCs#174miguelmolina95 wants to merge 2 commits intomasterfrom
miguelmolina95 wants to merge 2 commits intomasterfrom
Conversation
Author
|
meow #dev-go @connor15mcc |
jcapote-lyft
approved these changes
May 14, 2025
| lastGC: scope.NewGauge("lastGC"), | ||
| pauseTotalNs: scope.NewCounter("pauseTotalNs"), | ||
| numGC: scope.NewCounter("numGC"), | ||
| pauseTotalNs: scope.NewGauge("pauseTotalNs"), |
There was a problem hiding this comment.
https://cs.opensource.google/go/go/+/refs/tags/go1.24.3:src/runtime/mstats.go;l=258-263
// PauseTotalNs is the cumulative nanoseconds in GC
// stop-the-world pauses since the program started
so pauseTotalNs is not a gauge, it is actually a counter
Author
There was a problem hiding this comment.
yeah I think we were looking at one of the broken charts wrong and the reason it was broken I gave more context in the thread https://lyft.slack.com/archives/C0KLXB3KN/p1747250876491629 and updated the doc
Author
|
closing this with context on thread https://lyft.slack.com/archives/C0KLXB3KN/p1747250876491629 as we will fix the charts first |
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.
First of a series of fixes to make the obs of Go runtime stats better: WIP doc https://docs.google.com/document/d/1qGNgOgRV1FEuMlXIy0vzEvKdqRXYlYLGONaI0czs5d8/edit?tab=t.0
First issue we found is a couple of counters that are being misused and leading to an unbounded increment and then being divided by itself leading to a 1 value all the time.
Example with Etaproxy
If you look at the 2 counters we are changing right now and check the units you can see how they are growing unbounded and why gauge might be better:
pauseTotalNs: https://alerts.lyft.net/chart_v2/c6u11FIXgf?qs=%7B%22t%22%3A%7B%22startTimeMs%22%3A1747242870566%2C%22endTimeMs%22%3A1747249917735%7D%2C%22s%22%3A%5B%5D%7D
numGC: https://alerts.lyft.net/chart_v2/mTZNYUVfav?qs=%7B%22t%22%3A%7B%22startTimeMs%22%3A1747242881886%2C%22endTimeMs%22%3A1747249889433%7D%2C%22s%22%3A%5B%5D%7D