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

refactor!: refactor how we do defaults for runtime overrides #12448

Merged
merged 13 commits into from
Apr 3, 2024

Conversation

slim-bean
Copy link
Collaborator

What this PR does / why we need it:

We introduced a "defaults" section into the runtime overrides for runtime configs, however this prevented us from being able to set a default for these values without providing a runtime config.

we already have a pattern for this we used for limits_config so this PR refactors those defaults to be a first class object in the loki config and follows the same pattern of setting this as defaults.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • CHANGELOG.md updated
    • If the change is worth mentioning in the release notes, add add-to-release-notes label
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • For Helm chart changes bump the Helm chart version in production/helm/loki/Chart.yaml and update production/helm/loki/CHANGELOG.md and production/helm/loki/README.md. Example PR
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

Signed-off-by: Edward Welch <edward.welch@grafana.com>
@slim-bean slim-bean requested a review from a team as a code owner April 3, 2024 16:13
pkg/loki/loki.go Outdated
Tracing tracing.Config `yaml:"tracing"`
Analytics analytics.Config `yaml:"analytics"`
RuntimeConfig runtimeconfig.Config `yaml:"runtime_config,omitempty"`
OperationConfig runtime.Config `yaml:"operation_config,omitempty"`
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

struggling a bit with the name here.....

Copy link
Contributor

@DylanGuedes DylanGuedes left a comment

Choose a reason for hiding this comment

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

looks awesome.

could you add a changelog entry (since it is a breaking change)?

pkg/runtime/config.go Outdated Show resolved Hide resolved
Co-authored-by: Dylan Guedes <djmgguedes@gmail.com>
@slim-bean
Copy link
Collaborator Author

slim-bean commented Apr 3, 2024

could you add a changelog entry (since it is a breaking change)?

it's only a breaking change for us right now, I don't believe we ever released code with that default section in the runtime config? that didn't make it into 2.9 I don't think?

Update: this did make it into 2.9

Signed-off-by: Edward Welch <edward.welch@grafana.com>
Signed-off-by: Edward Welch <edward.welch@grafana.com>
@slim-bean slim-bean changed the title chore: refactor how we do defaults for runtime overrides BREAKING CHANGE: refactor how we do defaults for runtime overrides Apr 3, 2024
Signed-off-by: Edward Welch <edward.welch@grafana.com>
@pull-request-size pull-request-size bot added size/L and removed size/M labels Apr 3, 2024
@github-actions github-actions bot added the type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories label Apr 3, 2024
Signed-off-by: Edward Welch <edward.welch@grafana.com>
Signed-off-by: Edward Welch <edward.welch@grafana.com>
Signed-off-by: Edward Welch <edward.welch@grafana.com>
Copy link
Contributor

@JStickler JStickler left a comment

Choose a reason for hiding this comment

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

[docs team] Couple of small copyedits.

docs/sources/configure/_index.md Outdated Show resolved Hide resolved
docs/sources/setup/upgrade/_index.md Outdated Show resolved Hide resolved
docs/sources/setup/upgrade/_index.md Outdated Show resolved Hide resolved
slim-bean and others added 3 commits April 3, 2024 13:38
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
@slim-bean slim-bean changed the title BREAKING CHANGE: refactor how we do defaults for runtime overrides refactor!: refactor how we do defaults for runtime overrides Apr 3, 2024
Signed-off-by: Edward Welch <edward.welch@grafana.com>
Signed-off-by: Edward Welch <edward.welch@grafana.com>
@slim-bean slim-bean merged commit d39dc09 into main Apr 3, 2024
11 checks passed
@slim-bean slim-bean deleted the change-defaults-for-runtime-configs branch April 3, 2024 18:35
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…#12448)

Signed-off-by: Edward Welch <edward.welch@grafana.com>
Co-authored-by: Dylan Guedes <djmgguedes@gmail.com>
Co-authored-by: J Stickler <julie.stickler@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants