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

docs: how to convert config to per tenant limit #5446

Merged

Conversation

francoposa
Copy link
Member

@francoposa francoposa commented Jul 7, 2023

What this PR does

Adds a doc to docs/internal about how to migrate global config options to tenant-specific config.

There are a ton of minor steps here particularly in regards to maintaining compatibility through the deprecation period for the old, global config option.

A playbook was suggested to make sure we didn't miss anything, as we will certainly need to do this again.

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]

@francoposa francoposa marked this pull request as ready for review July 7, 2023 17:44
@francoposa francoposa requested review from a team as code owners July 7, 2023 17:44
@francoposa francoposa force-pushed the francoposa/docs-how-to-convert-config-to-per-tenant-limit branch from 46f8e8d to efcfef7 Compare July 7, 2023 18:01

## Deprecating the Existing Config Option

1. Move the config option description JSON object from its previous location to the "limits" block of `cmd/mimir/config-descriptor.json`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is automatically generated when make reference-help is run. It shouldn't be modified manually.


3. Expose the tenant-specific overrides for the new config option

First add the tenant-specific method and docstring to the _interface_ which uses the config option.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using an interface like this is specific to the way limits are used in this particular area of the code. Can you note that this pattern of adding the setting to an interface may not apply in all cases?


Similar helper functions may already exist for similar purposes: `SmallestPositiveNonZeroIntPerTenant`, `LargestPositiveNonZeroDurationPerTenant`, etc.

5. Consume the overrides with the multiple tenant limits.
Copy link
Contributor

Choose a reason for hiding this comment

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

Using the limits from multiple tenants at once is specific to the read path. Can you note that here or mark this step as optional?

@francoposa
Copy link
Member Author

@56quarters I believe all feedback is addressed

@francoposa francoposa force-pushed the francoposa/docs-how-to-convert-config-to-per-tenant-limit branch from 15d4dc5 to fec4872 Compare July 13, 2023 21:44
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Good job, LGTM! I'm merging given I think Nick's comments have been applied.

@pracucci pracucci merged commit 4897e22 into main Jul 18, 2023
28 checks passed
@pracucci pracucci deleted the francoposa/docs-how-to-convert-config-to-per-tenant-limit branch July 18, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants