Skip to content

Reduce snapshot lock hold time in metrics collector#3433

Open
fedexcc wants to merge 1 commit into
orchestration-agent:mainfrom
fedexcc:codex/bounty-2694-snapshot-lock-reduction
Open

Reduce snapshot lock hold time in metrics collector#3433
fedexcc wants to merge 1 commit into
orchestration-agent:mainfrom
fedexcc:codex/bounty-2694-snapshot-lock-reduction

Conversation

@fedexcc
Copy link
Copy Markdown

@fedexcc fedexcc commented May 23, 2026

Fixes #2694

Summary

  • refactor snapshot() to copy counters/gauges/histogram samples under lock
  • perform histogram aggregation outside lock to reduce contention during export
  • avoid lock re-entry in stop_timer() by appending duration directly under the same lock
  • add regression test asserting concurrent writes can proceed while snapshot aggregation runs

Validation

  • pytest -q tests/test_metrics.py
  • 5 passed

/claim #2694

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.

[ Bounty $3k ] [ Metrics ] Shorten snapshot lock hold time — threaded exporters

1 participant