Skip to content

feat(serverless): add storage and monthly spend limits per space - #564

Merged
Robert-Stam merged 2 commits into
mainfrom
feat/serverless-space-limits
Nov 16, 2026
Merged

Robert-Stam merged 2 commits into
mainfrom
feat/serverless-space-limits

Conversation

@Robert-Stam

Copy link
Copy Markdown
Contributor

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 (SpaceService 2.1.1 → 2.2.0)

  • storage_limit (StorageLimit): max_size in bytes, type, alert_threshold_percent.
  • monthly_spend_limit (SpendLimit): max_amount_millicents (USD; $50 = 5000000), type, alert_threshold_percent, and a read-only currency. It covers searches and writes; storage cost is not included. The period is the calendar month in UTC.
  • An unset field means unlimited, which is the default for new spaces. To remove a limit, include its path in update_mask and leave the field unset.
  • LimitType: HARD or SOFT. If UNSPECIFIED is sent, the server stores HARD and always returns an explicit value.
  • alert_threshold_percent: 1 to 99, defaults to 80.
  • Limits are set through the existing UpdateSpace RPC, so changing them requires write:serverless_spaces. No new RPC is added.
  • A limit can be set below current usage, and it takes effect right away.

Hard limit behavior:

Limit At 100% Resumes when
Storage Upserts rejected; searches and deletes work Storage drops below the limit, or the limit is raised, switched to soft, or removed
Spend All reads and writes rejected, including deletes The next month starts, or the limit is raised, switched to soft, or removed

Status: SpaceState.limits (read-only)

  • access_mode (SpaceAccessMode): FULL, WRITES_BLOCKED (hard storage limit reached), or BLOCKED (hard spend limit reached). When both are reached, the most restrictive mode applies.
  • storage.used_size and monthly_spend.used_amount_millicents are reported even when no limit is set, each with a LimitUsageLevel (UNLIMITED, OK, THRESHOLD_REACHED, LIMIT_REACHED).
  • monthly_spend.period_start and period_end give the current spend period. When a hard spend limit is reached, operations resume at period_end.
  • Usage is refreshed about every 5 minutes, and limits are enforced on the refreshed values.
  • phase stays READY while a limit blocks the space. DISABLED keeps its current meaning.

Alerts: SpaceAlertType (MonitoringService 2.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

  • Additive only: new fields, messages, and enum values. buf lint and buf breaking pass.
  • UpdateSpace without update_mask replaces the whole space. A client that doesn't know these fields and sends a full update clears both limits back to unlimited. collection_settings already behaves this way.

Not in this PR

  • The error that data-plane requests get when a hard limit blocks them. Proposal: gRPC FAILED_PRECONDITION with an ErrorInfo reason of SPACE_STORAGE_LIMIT_REACHED or SPACE_SPEND_LIMIT_REACHED, plus a message that names the limit and how to resolve it. Not RESOURCE_EXHAUSTED: it maps to HTTP 429, which SDKs retry automatically.
  • Alert emails to the account owner, sent once per threshold per period.

Checklist

  • I checked whether new or changed RPCs need qdrant.cloud.event.v1.event_options for audit/event publishing. (No new RPCs; limit changes go through UpdateSpace, which already emits an updated event.)
  • If event_options is used, I checked whether additional_context_fields or additional_payload_fields are needed and kept them minimal. (Not applicable.)

🤖 Generated with Claude Code

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>
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

PR Packages Published

Python Package:

  • Version: 0.226.0.dev564+e6c3a74
  • Package: qdrant-cloud-public-api
  • Registry: https://us-python.pkg.dev/qdrant-cloud/python/
  • To update run: uv add qdrant-cloud-public-api==0.226.0.dev564+e6c3a74

NPM Package:

  • Version: 0.226.0-dev564.e6c3a74
  • Package: @qdrant/qdrant-cloud-public-api
  • Registry: https://us-npm.pkg.dev/qdrant-cloud/npm/
  • To update run: npm install @qdrant/qdrant-cloud-public-api@0.226.0-dev564.e6c3a74

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Pull Request / linting (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedNov 13, 2026, 7:11 PM

@github-actions

This comment has been minimized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bashofmann bashofmann left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@Robert-Stam
Robert-Stam marked this pull request as ready for review November 16, 2026 11:45
@Robert-Stam
Robert-Stam requested a review from a team as a code owner November 16, 2026 11:45
@Robert-Stam
Robert-Stam merged commit 00dd3cd into main Nov 16, 2026
11 checks passed
@Robert-Stam
Robert-Stam deleted the feat/serverless-space-limits branch November 16, 2026 11:46
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.

3 participants