-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clear metrics generator wal on start up #3548
Conversation
modules/generator/generator.go
Outdated
@@ -113,6 +113,9 @@ func New(cfg *Config, overrides metricsGeneratorOverrides, reg prometheus.Regist | |||
} | |||
|
|||
func (g *Generator) starting(ctx context.Context) (err error) { | |||
// clean the wal on start up | |||
os.RemoveAll(g.cfg.Storage.Path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
even if we don't fail on the error, we should log it if it's non-nil
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a simple enough change with hopefully a big impact. add a changelog please.
one other request:
i do not know the startup logic for the prom rw clients and if putting this code in starting
could have a negative impact. can you verify that the prom clients are not initialized until after this line? if you have any concern you could move it to the new method.
What this PR does: Set metrics generator to clear its wal on start up.
Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]