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

Add count to 'loki_ingester_memory_chunks' when recovery from wal #4272

Merged
merged 1 commit into from
Sep 28, 2021

Conversation

taisho6339
Copy link
Contributor

@taisho6339 taisho6339 commented Sep 5, 2021

What this PR does / why we need it:

"loki_ingester_memory_chunks" isn't incremented when WAL recovery is executed so I've fixed.

Which issue(s) this PR fixes:
Fixes #4004

@taisho6339 taisho6339 requested a review from a team as a code owner September 5, 2021 15:26
@CLAassistant
Copy link

CLAassistant commented Sep 5, 2021

CLA assistant check
All committers have signed the CLA.


if len(s.chunks) != prevNumChunks {
memoryChunks.Add(float64(len(s.chunks) - prevNumChunks))
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code should be executed before the failure handling because some chunks may be stored in memory even if others is failed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@taisho6339 taisho6339 changed the title Add 'loki_ingester_memory_chunks' when recovery from wal Add count to 'loki_ingester_memory_chunks' when recovery from wal Sep 6, 2021
Copy link
Member

@owen-d owen-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great :). Sorry it took so long for me to review it.


if len(s.chunks) != prevNumChunks {
memoryChunks.Add(float64(len(s.chunks) - prevNumChunks))
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch!

@owen-d owen-d merged commit 502750d into grafana:main Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

loki_ingester_memory_chunks metric doesn't account for WAL replay
3 participants