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

mimirtool config: small migration and flags output convenience #1510

Merged
merged 6 commits into from
Mar 21, 2022

Conversation

dimitarvdimitrov
Copy link
Contributor

What this PR does

  • there is a new flag frontend.results_cache.backend, which has only a single value memcached and is empty by default. The backend hasn't changed since cortex, so this new flag needs to be set when cortex's query_range.cache_results==true
  • sort flags before outputting
  • the tool sometimes outputs YAML when no YAML was provided (e.g. it always outputs server.http_listen_port:80 when the port wasn't explicitly set), this YAML is confusing and is likely to be ignored even though it shouldn't be. This PR changes the tool to output in the same format as the input files
  • removes pruneNils, it is replaced by an if in InspectedEntry.MarshalYAML

Which issue(s) this PR fixes or relates to

Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
…cortex

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>
Co-authored-by: Mauro Stettler <mauro.stettler@gmail.com>
Copy link
Member

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

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

LGTM

@pstibrany pstibrany enabled auto-merge (squash) March 21, 2022 07:30
@pstibrany pstibrany merged commit 667224f into main Mar 21, 2022
@pstibrany pstibrany deleted the dimitar/mimirtool-out-format-same-as-in-format branch March 21, 2022 07:48
pracucci pushed a commit that referenced this pull request Mar 21, 2022
* Output only YAML when only YAML was provided (same for CLI flags)

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Set frontend.results_cache.backend when results cache was enabled in cortex

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Sort output flags

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* My own nitpicks

Signed-off-by: Dimitar Dimitrov <dimitar.dimitrov@grafana.com>

* Update pkg/mimirtool/config/convert.go

Co-authored-by: Mauro Stettler <mauro.stettler@gmail.com>

* Update pkg/mimirtool/config/convert_test.go

Co-authored-by: Mauro Stettler <mauro.stettler@gmail.com>
Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
@pracucci pracucci mentioned this pull request Mar 21, 2022
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants