Skip to content

Commit

Permalink
[receiver/expvar] Fix bug where measurement is recorded into wrong me…
Browse files Browse the repository at this point in the history
…tric. (#13172)

Noticed a bug where the mSpanSys value was higher than it should be. Turns out we were recording to mCacheSys value to that metric as well. This resulted in no mCacheSys metric and an incorrect mSpanSys metric. This PR fixes the issue.
  • Loading branch information
jamesmoessis authored Aug 12, 2022
1 parent 94d9600 commit 9d56ebd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion receiver/expvarreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (e *expVarScraper) scrape(ctx context.Context) (pmetric.Metrics, error) {
e.mb.RecordProcessRuntimeMemstatsMspanInuseDataPoint(now, int64(memStats.MSpanInuse))
e.mb.RecordProcessRuntimeMemstatsMspanSysDataPoint(now, int64(memStats.MSpanSys))
e.mb.RecordProcessRuntimeMemstatsMcacheInuseDataPoint(now, int64(memStats.MCacheInuse))
e.mb.RecordProcessRuntimeMemstatsMspanSysDataPoint(now, int64(memStats.MCacheSys))
e.mb.RecordProcessRuntimeMemstatsMcacheSysDataPoint(now, int64(memStats.MCacheSys))
e.mb.RecordProcessRuntimeMemstatsBuckHashSysDataPoint(now, int64(memStats.BuckHashSys))
e.mb.RecordProcessRuntimeMemstatsGcSysDataPoint(now, int64(memStats.GCSys))
e.mb.RecordProcessRuntimeMemstatsOtherSysDataPoint(now, int64(memStats.OtherSys))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,17 @@
"startTimeUnixNano": "1653023581589787000",
"timeUnixNano": "1653023581592037000",
"asInt": "81600"
},
}
],
"aggregationTemporality": "AGGREGATION_TEMPORALITY_CUMULATIVE"
}
},
{
"name": "process.runtime.memstats.mcache_sys",
"description": "Bytes of memory obtained from the OS for mcache structures.",
"unit": "By",
"sum": {
"dataPoints": [
{
"startTimeUnixNano": "1653023581589787000",
"timeUnixNano": "1653023581592037000",
Expand Down
4 changes: 4 additions & 0 deletions unreleased/expvar-bug-fix-#13172.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: bug_fix
component: expvarreceiver
note: "Fixes an bug where the mSpanSys value was recorded into the mCacheSys metric."
issues: [13171]

0 comments on commit 9d56ebd

Please sign in to comment.