Use more of the cortex frontend module to deduplicate some code and add the memcached backend#3114
Conversation
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
yeya24
left a comment
There was a problem hiding this comment.
Though this pr is still a draft, I just take an initial look. Hope you don't mind.
We are reusing Cortex config directly here. My idea is:
We can reuse the Cortex cache config. But it is not very good to reuse its Limits and QueryRange config, they contain some unnecessary fields for Thanos so what about using our own? It wouldn't be too much code to maintain, just some structs/type conversion between Cortex and Thanos.
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Yep I removed the Limits we can stil use the constructor though. |
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
|
@krasi-georgiev I believe this will add support for memcached as a cache backend. Could you please update the title and changelog accordingly? |
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
updated thanks |
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
9cc37c8 to
c8b4140
Compare
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
0a9ed13 to
b0bef06
Compare
There was a problem hiding this comment.
Thanks for all the work! 🥇
From my point of view, it is all good, just need to update the tests. Can I have some other 👀 to review this pr @kakkoyun @squat? Also some flags name and configs are changed, it would be good to add these changes to the changelog.
The Cortex cache config is a little bit complex, it would be good to add a Cortex doc link https://cortexmetrics.io/docs/configuration/configuration-file/. What do you think?
b0bef06 to
f152db6
Compare
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
3b18b76 to
026794d
Compare
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
83bdf2c to
f172f9d
Compare
kakkoyun
left a comment
There was a problem hiding this comment.
LGTM. Let's what others also think.
bwplotka
left a comment
There was a problem hiding this comment.
Awesome, minor nits only otherwise LGTM, thanks!
| Addresses: strings.Join(config.Memcached.Addresses, ","), | ||
| UpdateInterval: config.Memcached.DNSProviderUpdateInterval, | ||
| }, | ||
| Background: cortexcache.BackgroundConfig{ |
There was a problem hiding this comment.
Anything looks strange here?
yeya24
left a comment
There was a problem hiding this comment.
Some very small nits, overall LGTM 🚀
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
Signed-off-by: Krasi Georgiev <8903888+krasi-georgiev@users.noreply.github.com>
fd595a5 to
c41ba79
Compare
taking over for Bens PR :#3032
Signed-off-by: Krasi Georgiev 8903888+krasi-georgiev@users.noreply.github.com