Skip to content

Add proposal for tenant limits API #6818

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 3 commits into
base: master
Choose a base branch
from

Conversation

bogdan-at-adobe
Copy link

@bogdan-at-adobe bogdan-at-adobe commented Jun 14, 2025

What this PR does:

This PR adds a proposal for a tenant limits API.

Which issue(s) this PR fixes:
Fixes #

Checklist

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

@bogdan-at-adobe
Copy link
Author

Hello, this has been something that has been bothering me and my team for a while.
I would love to work on this, even though I don't have much knowledge about what it would take to implement something like this and will probably need some guidance.

Copy link
Member

@friedrichg friedrichg left a comment

Choose a reason for hiding this comment

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

Thanks for this. it's a great idea


### Endpoints

#### 1. GET /api/v1/limits/{tenant_id}
Copy link
Member

Choose a reason for hiding this comment

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

The standard way to specify the cortex tenant is using the header X-Scope-OrgID. We don't need the extra tenant_id in the path.

- Trigger a reload of the runtime config

2. Security:
- The API will require admin-level authentication
Copy link
Member

Choose a reason for hiding this comment

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

This is out of scope for cortex per se. As long as we get the right header in cortex, we should modify the limits for the tenant


2. Security:
- The API will require admin-level authentication
- Rate limiting will be implemented to prevent abuse
Copy link
Member

Choose a reason for hiding this comment

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

👍

2. Security:
- The API will require admin-level authentication
- Rate limiting will be implemented to prevent abuse
- Changes will be validated before being applied
Copy link
Member

Choose a reason for hiding this comment

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

👍


1. The API will be integrated into the existing Cortex components to:
- Read the current runtime config from the configured storage backend
- Apply changes to the in-memory configuration
Copy link
Member

Choose a reason for hiding this comment

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

We don't need this line, it's not how it works today

- Read the current runtime config from the configured storage backend
- Apply changes to the in-memory configuration
- Persist changes back to the storage backend
- Trigger a reload of the runtime config
Copy link
Member

Choose a reason for hiding this comment

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

This line is already implemented in all cortex components. No need to say it here.


### Implementation Details

1. The API will be integrated into the existing Cortex components to:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
1. The API will be integrated into the existing Cortex components to:
1. The API will be integrated into the cortex-overrides component

We already have a component that reads limits, so it's perfect for this use case.

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.

2 participants