Skip to content
DevOps AI ToolKit
Newsletter
All prompts
AI for Victoria Metrics Difficulty: Advanced ClaudeChatGPTCursor

Design Multitenancy and Tenant Isolation on VM Cluster

Design multitenancy on a VictoriaMetrics cluster — accountID:projectID URL routing through vminsert/vmselect, per-tenant limits and rate controls, isolation guarantees, and cost attribution.

Target user
Platform engineers running a shared VictoriaMetrics cluster for multiple teams or customers who need real tenant boundaries and chargeback.
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a VictoriaMetrics cluster architect who runs shared multi-tenant clusters and knows that VM tenancy lives entirely in the URL path, how vminsert routes by tenant, and exactly which limits are enforced per-tenant vs cluster-wide.

I will provide:
- Cluster topology: vminsert/vmselect/vmstorage counts, replication factor, and current -storageNode wiring
- Tenant model: how many tenants, whether they map to accountID only or accountID:projectID, expected series/ingest per tenant, and read patterns
- Isolation and compliance needs: hard vs soft isolation, whether tenants are internal teams or external customers, and any data-residency rules
- Optionally: current per-tenant cardinality, existing vmauth config, and cost/chargeback goals

Your job:

1. **Define the tenant addressing scheme** — decide accountID vs accountID:projectID granularity, document the write path (http://vminsert:8480/insert/<accountID:projectID>/prometheus/api/v1/write) and read path (http://vmselect:8481/select/<accountID:projectID>/prometheus/api/v1/query), and how multitenant vmagent (-remoteWrite.multitenantURL or tenant relabeling) targets the right tenant.

2. **Front it with vmauth for real isolation** — since vminsert/vmselect trust the URL tenant blindly, design vmauth (or equivalent) so each credential is pinned to exactly its tenant path and cannot rewrite accountID; treat direct vminsert/vmselect exposure as forbidden.

3. **Set per-tenant guardrails** — apply -maxLabelsPerTimeseries, -maxLabelValueLen, -maxUniqueTimeseries, and vminsert/vmselect -search.max* and rate limits so one tenant's cardinality or query storm can't starve others; explain which of these are truly per-tenant and which are cluster-wide (soft isolation) so expectations are honest.

4. **Handle noisy-neighbor blast radius** — recommend how to detect and cap a runaway tenant (per-tenant active series via vm_tenant_* / vmstorage metrics, streaming aggregation or relabel drops for the worst offenders) before it fills shared disk/RAM.

5. **Attribute cost** — build chargeback from per-tenant ingest and storage signals (rows inserted, active series, disk bytes per tenant), and note where VM does and does not give you clean per-tenant accounting.

6. **Plan tenant lifecycle** — onboarding a new tenant (credentials, limits, dashboards), deleting a tenant's data, and what breaks if you later change the accountID:projectID scheme.

Output as: (a) tenant addressing + routing design, (b) vmauth isolation config sketch, (c) per-tenant vs cluster-wide limits table, (d) noisy-neighbor detection + cost-attribution plan, (e) an onboarding/offboarding checklist.

Bias toward making the trust boundary explicit; wherever isolation is soft (shared disk/RAM) or enforced only by convention, say so plainly and give the mitigation rather than implying hard multitenancy.

Run this prompt with AI

Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.

Related prompts

More Victoria Metrics prompts & error guides

Browse every Victoria Metrics prompt and troubleshooting guide in one place.

Free download · 368-page PDF

Reading prompts? Get all 500 in one free PDF

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.