Skip to content

feat: add procfs process tracking#1288

Merged
preinlein merged 5 commits intomainfrom
paul.reinlein/add-procfs-process-tracking
Mar 25, 2025
Merged

feat: add procfs process tracking#1288
preinlein merged 5 commits intomainfrom
paul.reinlein/add-procfs-process-tracking

Conversation

@preinlein
Copy link
Copy Markdown
Contributor

@preinlein preinlein commented Mar 20, 2025

What does this PR do?

This adds a gauge for the number of processes processed in procfs & adds a warning log for when we failed to process processes.

Motivation

We noticed some spikes in the aggregator numbers that we can't attribute too well with our current observability.

By adding these data points, we'll be better able to understand what's happening when these spikes occur.

Related issues

N/A

Additional Notes

N/A

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@preinlein preinlein marked this pull request as ready for review March 20, 2025 17:43
@preinlein preinlein requested a review from a team as a code owner March 20, 2025 17:43
@preinlein preinlein marked this pull request as draft March 20, 2025 17:52
@preinlein preinlein removed the request for review from a team March 20, 2025 17:52
@preinlein preinlein force-pushed the paul.reinlein/add-procfs-process-tracking branch 5 times, most recently from 715cd3b to 88f4254 Compare March 21, 2025 13:18
@@ -238,7 +261,7 @@ impl Sampler {
// which will happen if we don't have permissions or, more
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the GH UI is preventing me from commenting on the right line but the:

let uptime = uptime::poll().await?;

is preventing us from simplifying the return to simply be bool

@preinlein preinlein force-pushed the paul.reinlein/add-procfs-process-tracking branch from 5033033 to ee9f56c Compare March 24, 2025 20:17
@preinlein preinlein marked this pull request as ready for review March 24, 2025 20:19

gauge!("total_rss_bytes").set(aggr.rss as f64);
gauge!("total_pss_bytes").set(aggr.pss as f64);
gauge!("processes_found").set(processes_found as f64);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to go with consistency rather than correctness here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lint doesn't need a change in the types, just in conversion. I think you can replace this with

Suggested change
gauge!("processes_found").set(processes_found as f64);
gauge!("processes_found").set(processes_found.into());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See our previous conversation: #1288 (comment)

I'd prefer to do a pass after where we address all of these together.

@preinlein preinlein enabled auto-merge (squash) March 25, 2025 14:44
@preinlein preinlein merged commit fa9b42d into main Mar 25, 2025
21 checks passed
@preinlein preinlein deleted the paul.reinlein/add-procfs-process-tracking branch March 25, 2025 14:51
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.

4 participants