Skip to content

[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

Merged
merged 3 commits into from
Mar 17, 2025

Conversation

braydonk
Copy link
Contributor

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.

This PR adds metrics to the memory scraper track Dirty memory information
reported by /proc/meminfo.
@braydonk braydonk requested review from dmitryax and a team as code owners March 17, 2025 14:04
@braydonk braydonk changed the title Add Linux Dirty memory metrics [receiver/hostmetrics] Add Linux Dirty memory metrics Mar 17, 2025
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.
Copy link
Member

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())
Copy link
Member

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) {
Copy link
Member

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 :)

@braydonk
Copy link
Contributor Author

Whoops yeah I was a bit trigger-happy. Review comments addressed in 2611c50

@dmitryax dmitryax merged commit 6e45f14 into open-telemetry:main Mar 17, 2025
171 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/hostmetrics] Add Dirty memory metrics
3 participants