Skip to content

clear metrics generator wal on start up#3548

Merged
ie-pham merged 4 commits intografana:mainfrom
ie-pham:mgenWal
Apr 19, 2024
Merged

clear metrics generator wal on start up#3548
ie-pham merged 4 commits intografana:mainfrom
ie-pham:mgenWal

Conversation

@ie-pham
Copy link
Copy Markdown
Contributor

@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]

Comment thread modules/generator/generator.go Outdated

func (g *Generator) starting(ctx context.Context) (err error) {
// clean the wal on start up
os.RemoveAll(g.cfg.Storage.Path)
Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Collaborator

@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.

Comment thread modules/generator/storage/instance.go
@ie-pham ie-pham merged commit 7f6d590 into grafana:main Apr 19, 2024
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.

2 participants