-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[receiver/hostmetrics] Add Linux Dirty memory metrics #38673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This PR adds metrics to the memory scraper track Dirty memory information reported by /proc/meminfo.
receiver/hostmetricsreceiver/internal/scraper/memoryscraper/metadata.yaml
Outdated
Show resolved
Hide resolved
receiver/hostmetricsreceiver/internal/scraper/memoryscraper/memory_scraper_linux.go
Outdated
Show resolved
Hide resolved
component: hostmetricsreceiver | ||
|
||
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). | ||
note: Added the `system.linux.memory.dirty` and `system.linux.memory.dirty.page.count` metrics. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update this
"github.com/shirou/gopsutil/v4/mem" | ||
"go.opentelemetry.io/collector/pdata/pcommon" | ||
|
||
"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver/internal/scraper/memoryscraper/internal/metadata" | ||
) | ||
|
||
var pageSize = int64(os.Getpagesize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not needed anymore, right?
@@ -74,3 +83,7 @@ func (s *memoryScraper) scrape(ctx context.Context) (pmetric.Metrics, error) { | |||
|
|||
return s.mb.Emit(), nil | |||
} | |||
|
|||
func (s *memoryScraper) recordMemoryPageSizeMetric(now pcommon.Timestamp) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not called anywhere looks like :)
Whoops yeah I was a bit trigger-happy. Review comments addressed in 2611c50 |
Description
This PR adds metrics to the memory scraper track Dirty memory information reported by /proc/meminfo.
Link to tracking issue
Fixes #38672
Testing
Generated by
mdatagen
.Documentation
Unit tests added to cover the new metrics.