-
Notifications
You must be signed in to change notification settings - Fork 544
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
Common storage backend config #2330
Conversation
I would preferred that as well, but if it's too complex the current behaviour looks acceptable to me (as far as will be properly documented). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solid work! LGTM.
We need documentation for that, but it can be done in a follow up PR, so that we don't block it on doc reviews.
f5c0916
to
fc1f8a4
Compare
I've updated some tests and the tutorial to use common flags (I've left couple of tests using specific configurations, to have both of them). I also extracted root blocks for common and providers configs as you suggested, @pracucci. Re-requesting review since there have been a bunch of changes here, meanwhile I'll start working on adding some better docs for this (I'll include docs squad as reviewer in those). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! (modulo few minor comments)
Have you manually tried the tutorial? If yes, LGTM, otherwise please test it 😉
# The s3_backend block configures the connection to Amazon S3 object storage | ||
# backend. | ||
# The CLI flags prefix for this block configuration is: common.storage | ||
[s3: <s3_storage_backend>] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember docs squad want to call it as the YAML config field name, so I would rename s3_storage_backend
to s3
. However, naming is very generic here (e.g. filesystem
) and I personally like your naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I followed the same reasoning, wanted to go with just s3
, gcs
, etc, but they just looked too generic here, especially filesystem
, which is not an object-storage per se.
docs/sources/operators-guide/configuring/reference-configuration-parameters/index.md
Outdated
Show resolved
Hide resolved
Going to merge this as the docs will come in later, and I don't want to spend my days rebasing all the e2e tests. |
LGTM merging it. |
f185a6b
to
df7d532
Compare
Rebased. |
We don't want to make the entire Bucket config common, because: - We need them to have different prefixes - They don't necessarily will reuse middlewares (actually, middlewares are not used at all right now). Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
These use three components: ruler, alertmanager and blocks storage, so they're a good candidate for the common config. The config renaming is partial and will be completed in the next change, to make the scope of this change smaller. Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> Co-authored-by: Marco Pracucci <marco.pracucci@grafana.com> Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
df7d532
to
d652246
Compare
Is there a container image available to use these changes? The most recently updated image tag available on DockerHub is r193-df12d7b which I don't think includes these changes yet:
|
* Extract storage backend config to a struct We don't want to make the entire Bucket config common, because: - We need them to have different prefixes - They don't necessarily will reuse middlewares (actually, middlewares are not used at all right now). Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Add common flags that can be overriden by specific Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Unmarshal common config yaml Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Fix typo Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * make license Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * make doc Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Use common config for ruler/alertmaneger e2e tests These use three components: ruler, alertmanager and blocks storage, so they're a good candidate for the common config. The config renaming is partial and will be completed in the next change, to make the scope of this change smaller. Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Simplify configs Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Use common.storage in the tutorial Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Add TestQueryFrontendWithBlocksStorageViaCommonFlags Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Extract root blocks for common and storage backends Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Update CHANGELOG.md Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Remove sse root block Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Apply suggested CHANGELOG format Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> Co-authored-by: Marco Pracucci <marco.pracucci@grafana.com> Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Clarify comment Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> * Fix anchor after removing sse block Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com> Co-authored-by: Marco Pracucci <marco.pracucci@grafana.com>
There is now grafana/mimir:r194-61b589d which has this PR. In general, our weekly |
This is a great feature, thanks a lot for implementing it! |
Already done. |
Now we should start using it 💪 |
What this PR does
Adds a
common
configuration block to yaml, as well ascommon.
-prefixed flags that will allow configuring common values for all services.In this first iteration, we'll allow configuring a common storage backend.
The logic this follows is: flags override yaml, specific configs override common.
In particular, this means that a specific yaml configuration will be overridden by a common flag value (there's a test case for that). This is not exacty what I desired (I'd prefer to have "specific over common, flags over yaml" instead), but given the complexity of implementing the other option, I think we can accept the tradeoff.
Why is it complex to do the other option?
We would need to know how flags relate to specific struct fields (reflection-based) in order to know whether a common flag name doesn't have to be applied because it was set by yaml.
This is already hard since there's no [decent] way of sniffing what fields are being registered in the flagset with which names (actually, there might be no strict 1-1 relation between flags and fields, since
flag.Value
is just an interface that does stuff).If we were able to achieve that, we'd still need to be able to distinguish whether a specific config value is there just because it was a default value or otherwise it's because yaml stated the same value as the default one.
Which issue(s) this PR fixes or relates to
Relates to #2319
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]