Skip to content

fix(observability): add TTL-based eviction to prevent memory leak (#563) - #881

Open
Seunfunmi-319509 wants to merge 3 commits into
Iris-IV:mainfrom
Seunfunmi-319509:fix/563-observability-memory-leak-ttl-eviction
Open

fix(observability): add TTL-based eviction to prevent memory leak (#563)#881
Seunfunmi-319509 wants to merge 3 commits into
Iris-IV:mainfrom
Seunfunmi-319509:fix/563-observability-memory-leak-ttl-eviction

Conversation

@Seunfunmi-319509

Copy link
Copy Markdown

The module-level events array in metricsStore.ts grew without time-based bounds in long-running Node.js processes. Added a purgeStaleEvents() function that removes events older than 1 hour on every ingest and snapshot read, complementing the existing MAX_EVENTS size cap.

Summary

Closes #563

Type of Change

  • Bug fix
  • Feature
  • Chore / maintenance
  • Documentation
  • Test coverage

Contributor Checklist

  • Linked the related issue above.
  • Reviewed CONTRIBUTING.md for branch, commit, and PR title conventions.
  • Confirmed this follows the current Stellar Wave contribution flow, if applicable.
  • Added or updated tests when behavior changed.
  • Updated docs, examples, or translations when needed.

Validation

  • npm run lint
  • npm run format:check
  • npm run typecheck
  • npm test
  • npm run build
  • Not run; reason:

Notes for Reviewers

…is-IV#563)

The module-level events array in metricsStore.ts grew without time-based
bounds in long-running Node.js processes. Added a purgeStaleEvents()
function that removes events older than 1 hour on every ingest and
snapshot read, complementing the existing MAX_EVENTS size cap.
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Seunfunmi-319509 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

Comment thread scripts/check-i18n.mjs
const parts = fullKey.split(".");
const key = parts[parts.length - 1];
const namespace = parts.length > 1 ? parts[0] : '';
const namespace = parts.length > 1 ? parts[0] : "";
…MESSAGE error in NotificationBell/NotificationSettings
@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

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.

[Bug] observability recordObservabilityKind/Failure calls persist state to module-level Map — memory leak in long-running process

3 participants