Skip to content
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

Merged
merged 4 commits into from
Apr 19, 2024
Merged

Conversation

ie-pham
Copy link
Collaborator

@ie-pham ie-pham commented Apr 8, 2024

What this PR does: Set metrics generator to clear its wal on start up.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
@@ -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)
Copy link
Member

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

Copy link
Member

@joe-elliott joe-elliott left a 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.

@ie-pham ie-pham merged commit 7f6d590 into grafana:main Apr 19, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants