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

store: add histogram for postings size #5814

Merged
merged 1 commit into from Oct 24, 2022

Conversation

GiedriusS
Copy link
Member

Add a metric that shows the distribution of how many postings (in bytes) were needed for each Series() call. Useful for determining limits.

Signed-off-by: Giedrius Statkevičius giedrius.statkevicius@vinted.com

Add a metric that shows the distribution of how many postings (in bytes)
were needed for each Series() call. Useful for determining limits.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Copy link
Collaborator

@matej-g matej-g left a comment

Choose a reason for hiding this comment

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

Looks good, cc @douglascamata

@matej-g matej-g enabled auto-merge (squash) October 24, 2022 15:32
@matej-g matej-g merged commit 3642334 into thanos-io:main Oct 24, 2022
@@ -1137,6 +1146,7 @@ func (s *BucketStore) Series(req *storepb.SeriesRequest, srv storepb.Store_Serie
s.metrics.cachedPostingsCompressionTimeSeconds.WithLabelValues(labelDecode).Add(stats.CachedPostingsDecompressionTimeSum.Seconds())
s.metrics.cachedPostingsOriginalSizeBytes.Add(float64(stats.CachedPostingsOriginalSizeSum))
s.metrics.cachedPostingsCompressedSizeBytes.Add(float64(stats.CachedPostingsCompressedSizeSum))
s.metrics.postingsSizeBytes.Observe(float64(int(stats.PostingsFetchedSizeSum) + int(stats.PostingsTouchedSizeSum)))
Copy link
Contributor

Choose a reason for hiding this comment

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

@GiedriusS: Am I correct in assuming that "touched" means downloaded from cache and "fetched" means downloaded from object storage? Seems like so but I am not sure. 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

yep 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

One thing to note is that, we also update PostingsTouchedSizeSum when we write encoded postings back to cache even if we fetch those postings from object storage. I feel like this behavior makes the metric not that accurate.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this deserves fixing and its own issue, @yeya24. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I don't know if this is by design. @GiedriusS Do you know more about this

@douglascamata
Copy link
Contributor

@GiedriusS thanks a lot for this. 🙇

@GiedriusS GiedriusS deleted the postings_metric branch October 25, 2022 07:04
fpetkovski pushed a commit to fpetkovski/thanos that referenced this pull request Oct 25, 2022
Add a metric that shows the distribution of how many postings (in bytes)
were needed for each Series() call. Useful for determining limits.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
ngraham20 pushed a commit to ngraham20/thanos that referenced this pull request May 18, 2023
Add a metric that shows the distribution of how many postings (in bytes)
were needed for each Series() call. Useful for determining limits.

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>

Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
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.

None yet

5 participants