Skip to content

Reset stale process_thread_usage series each scrape#65

Merged
mempirate merged 4 commits into
mainfrom
drop-process-thread-usage-pid-label
Apr 15, 2026
Merged

Reset stale process_thread_usage series each scrape#65
mempirate merged 4 commits into
mainfrom
drop-process-thread-usage-pid-label

Conversation

@mempirate
Copy link
Copy Markdown
Contributor

@mempirate mempirate commented Apr 15, 2026

Summary

  • keep the pid and name labels on process_thread_usage
  • call reset() before repopulating the gauge vector on each collect
  • update docs/examples to reflect the PID-labelled metric output

Why

Keeping pid preserves exact per-thread identity, while reset() prevents stale thread series from accumulating in the exporter after threads exit.

Implementation notes

  • GaugeVec::reset() clears the previous scrape's label set before repopulating currently live thread series
  • this addresses stale series growth in the exporter, but intentionally keeps PID-labelled per-thread metrics

Testing

  • cargo test

@mempirate mempirate changed the title Drop pid label from process_thread_usage Reset stale process_thread_usage series each scrape Apr 15, 2026
@mempirate mempirate merged commit b065ac8 into main Apr 15, 2026
4 checks passed
@mempirate mempirate deleted the drop-process-thread-usage-pid-label branch April 15, 2026 09:23
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.

1 participant