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

feat: tenant settings ruler #3945

Draft
wants to merge 4 commits into
base: recording-rules-settings
Choose a base branch
from

Conversation

alsoba13
Copy link
Contributor

@alsoba13 alsoba13 commented Feb 24, 2025

NOTE: base branch of this set to #3946. do not merge

Tenant settings ruler is a thread-safe ruler that obtains rules from tenant-settings service and caches the result for later calls.

It holds a cache for each tenant, that expires after the default time (60s).
Every first call to a tenant for RecordingRules(tenant string) will initialize the per-tenant cache. When calling again the method, the cached rules will be served unless they expired. In that case, cache will be refreshed.

I discarded doing generics here becase (1) I would like to validate the idea first and (2) there's no need to generalize the cache.

Ruler needs a tenant settings client in place, I will create dependencies after @bryanhuhta.

Some detected todos:

  • Expiry time by config (default 60s)

@alsoba13 alsoba13 changed the title feat: tenant sttings ruler feat: tenant settings ruler Feb 24, 2025
@alsoba13 alsoba13 force-pushed the alsoba/tenant-settings-ruler branch from 21a6a15 to 4fd0061 Compare February 25, 2025 13:49
@alsoba13 alsoba13 changed the base branch from main to recording-rules-settings February 25, 2025 13:50
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.

2 participants