Skip to content

Allow configuring local metrics retention in days - #2484

Open
svarlamov-oai wants to merge 3 commits into
mainfrom
metrics-retention-2483
Open

svarlamov-oai wants to merge 3 commits into
mainfrom
metrics-retention-2483

Conversation

@svarlamov-oai

@svarlamov-oai svarlamov-oai commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #2483.

Set GIT_AI_METRICS_RETENTION_DAYS=7 in the daemon's environment to keep seven days of local metrics. The persistent equivalent is git-ai config set metrics_retention_days 7. Restart a running daemon with git-ai bg restart to pick up the change.

Like transcript_streaming_lookback_days, the setting is resolved when git-ai loads its configuration. A valid environment value takes precedence over the value in ~/.git-ai/config.json. With neither set, the default is 365 days. The existing daily prune applies the resolved window to both delivered and pending metrics. SQLite can reuse the freed pages, so the file may retain its current size.

The CLI regression covers set, get, unset, and precedence. It also verifies that a malformed retention value preserves other file settings and can be repaired through the CLI. A daemon regression starts with an existing database, exercises file configuration and an environment override, and checks that the eight-day-old row expires while the six-day-old row survives.


Devin Review

@devin-ai-integration devin-ai-integration Bot left a comment •

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.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

This branch has not been deployed

No deployments
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.

# Feature: Make metrics retention configurable (METRICS_RETENTION_SECS)

1 participant