Repository navigation
Allow configuring local metrics retention in days - #2484
Open
svarlamov-oai wants to merge 3 commits into
Open
svarlamov-oai wants to merge 3 commits into
svarlamov-oai wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2483.
Set
GIT_AI_METRICS_RETENTION_DAYS=7in the daemon's environment to keep seven days of local metrics. The persistent equivalent isgit-ai config set metrics_retention_days 7. Restart a running daemon withgit-ai bg restartto 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.