Repository navigation
feat(serverless): add storage and monthly spend limits per space - #564
Merged
Merged
Conversation
Customers can cap the storage and the monthly search and write spend of a serverless space, as a hard or soft limit with an alert threshold. - SpaceConfiguration.storage_limit and monthly_spend_limit, writable via UpdateSpace. Unset means unlimited. - SpaceState.limits reports usage against each limit and the operations the space currently accepts (SpaceAccessMode). - Four new SpaceAlertType values for threshold and limit reached. SpaceService 2.1.1 -> 2.2.0, MonitoringService 2.3.0 -> 2.4.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
PR Packages Published Python Package:
NPM Package:
|
|
The latest Buf updates on your PR. Results from workflow Pull Request / linting (pull_request).
|
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
forgems
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Customers can cap the storage and the monthly spend of each serverless space, so they don't get unexpected bills. Each limit is either hard (operations are blocked at 100%) or soft (alert only), and has an alert threshold.
Settings:
SpaceConfiguration(SpaceService2.1.1 → 2.2.0)storage_limit(StorageLimit):max_sizein bytes,type,alert_threshold_percent.monthly_spend_limit(SpendLimit):max_amount_millicents(USD; $50 = 5000000),type,alert_threshold_percent, and a read-onlycurrency. It covers searches and writes; storage cost is not included. The period is the calendar month in UTC.update_maskand leave the field unset.LimitType:HARDorSOFT. IfUNSPECIFIEDis sent, the server storesHARDand always returns an explicit value.alert_threshold_percent: 1 to 99, defaults to 80.UpdateSpaceRPC, so changing them requireswrite:serverless_spaces. No new RPC is added.Hard limit behavior:
Status:
SpaceState.limits(read-only)access_mode(SpaceAccessMode):FULL,WRITES_BLOCKED(hard storage limit reached), orBLOCKED(hard spend limit reached). When both are reached, the most restrictive mode applies.storage.used_sizeandmonthly_spend.used_amount_millicentsare reported even when no limit is set, each with aLimitUsageLevel(UNLIMITED,OK,THRESHOLD_REACHED,LIMIT_REACHED).monthly_spend.period_startandperiod_endgive the current spend period. When a hard spend limit is reached, operations resume atperiod_end.phasestaysREADYwhile a limit blocks the space.DISABLEDkeeps its current meaning.Alerts:
SpaceAlertType(MonitoringService2.3.0 → 2.4.0)New values for
ListSpaceAlerts:STORAGE_LIMIT_THRESHOLD_REACHED(6)STORAGE_LIMIT_REACHED(7)SPEND_LIMIT_THRESHOLD_REACHED(8)SPEND_LIMIT_REACHED(9)Compatibility
buf lintandbuf breakingpass.UpdateSpacewithoutupdate_maskreplaces the whole space. A client that doesn't know these fields and sends a full update clears both limits back to unlimited.collection_settingsalready behaves this way.Not in this PR
FAILED_PRECONDITIONwith anErrorInforeason ofSPACE_STORAGE_LIMIT_REACHEDorSPACE_SPEND_LIMIT_REACHED, plus a message that names the limit and how to resolve it. NotRESOURCE_EXHAUSTED: it maps to HTTP 429, which SDKs retry automatically.Checklist
qdrant.cloud.event.v1.event_optionsfor audit/event publishing. (No new RPCs; limit changes go throughUpdateSpace, which already emits an updated event.)event_optionsis used, I checked whetheradditional_context_fieldsoradditional_payload_fieldsare needed and kept them minimal. (Not applicable.)🤖 Generated with Claude Code