Skip to content

Introduce a regex tenant resolver #6713

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SungJin1212
Copy link
Member

@SungJin1212 SungJin1212 commented Apr 22, 2025

This PR introduces a regex tenant resolver to allow regex in the X-Scope-OrgID value when the user uses tenant-federation feature.
It introduces two flags, tenant-federation.regex-matcher-enabled and tenant-federation.user-sync-interval.

  • The tenant-federation.regex-matcher-enabled enables the regex resolver, which allows regex to the X-Scope-OrgID value.
  • The tenant-federation.user-sync-interval specifies how frequently to scan users. The scanned users are used to calculate matched tenantIDs.

The regex matching rule follows the Prometheus regex matcher (=~), See here.

For example, if there are 3 tenants, whose IDs are user-1, user-2, and user-3. We can set X-Scope-OrgID to user-.+ to query whole tenants.
Also, we can use an existing way like setting user-1|user-2|user-3 to X-Scope-OrgID.

Which issue(s) this PR fixes:
Fixes #6588

Checklist

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

@SungJin1212 SungJin1212 marked this pull request as draft April 22, 2025 01:29
@SungJin1212 SungJin1212 force-pushed the Support-regex-to-tenant-federation branch 7 times, most recently from 02d75af to e87cb4d Compare April 22, 2025 05:39
@SungJin1212 SungJin1212 force-pushed the Support-regex-to-tenant-federation branch from 1b8963e to e6a4222 Compare April 22, 2025 06:02
@SungJin1212 SungJin1212 marked this pull request as ready for review April 22, 2025 06:27
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.

Allow for dynamic tenant selection in query federation
1 participant