Conversation
bwplotka
left a comment
There was a problem hiding this comment.
I think it makes total sense (: Thanks.
Let's move to MustRegister and then LGTM. 👍
|
Thanks for reviewing, have updated to use |
bwplotka
left a comment
There was a problem hiding this comment.
Awesome, one nit, but not a blocker (:
| } | ||
| } | ||
|
|
||
| type DownsampleMetrics struct { |
There was a problem hiding this comment.
I think it can be private, right?
GiedriusS
left a comment
There was a problem hiding this comment.
One minor nit. Let me know if it makes sense. I think doing like I suggested makes the code base cleaner - there's less chance that we will have clashes between different "subsystems" who might try to register the same metrics
| } | ||
| }() | ||
|
|
||
| metrics := newDownsampleMetrics(reg) |
There was a problem hiding this comment.
Could we use extprom.WrapRegistererWithPrefix("thanos_compact_downsample", reg) here?
There was a problem hiding this comment.
I think it makes sense but with thanos_compact prefix, but not a blocker.
| func newDownsampleMetrics(reg *prometheus.Registry) *DownsampleMetrics { | ||
| m := new(DownsampleMetrics) | ||
|
|
||
| m.downsamples = prometheus.NewCounterVec(prometheus.CounterOpts{ |
There was a problem hiding this comment.
Then we would only have total here
|
Merging in this form, we can improve that later once we actually need to reuse this component. |
|
Thanks @mattrco ! |
When
compactgoes into its downsampling step, no app metrics are reported, which makes our dashboard look a bit bare for several hours (sometimes days if we have a backlog). Adding a couple of metrics means we can alert if no compactions or downsamples have happened in x period.This is a little less clean than I'd like due to the two callers of
downsampleBuckethaving slightly different contexts, however I think it's a reasonable compromise. Let me know what you think!The metrics are labelled in the same way as compact metrics for ease of comparison.
Changes
Add
thanos_compact_downsample_totalandthanos_compact_downsample_failures_totaldownsampling metrics.Verification
Tests are passing, will run with real workloads.