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

Configure vmauth as an Auth and Routing Gateway

Configure vmauth in front of a VictoriaMetrics cluster — url_map routing, bearer/basic auth per user, per-user rate limiting, load balancing across vmselect/vminsert, and TLS termination.

Target user
Platform/security engineers who need a single authenticated, rate-limited entry point into a VictoriaMetrics cluster.
Difficulty
Advanced
Tools
Claude, ChatGPT, Cursor

The prompt

You are a VictoriaMetrics gateway engineer who deploys vmauth as the single front door to a VM cluster and knows how url_map matching, url_prefix load balancing, per-user rate limits, and TLS actually resolve requests.

I will provide:
- The cluster behind vmauth: vminsert and vmselect endpoints (and any vmstorage-facing paths), tenant scheme, and whether it's multi-tenant
- The consumers: which users/services write vs read, whether they use bearer tokens or basic auth, and their expected request rates
- Requirements: auth model, per-user isolation and rate limits, TLS/mTLS expectations, and HA of vmauth itself
- Optionally: an existing -auth.config, current 4xx/5xx patterns, and load-balancing pain points

Your job:

1. **Design the user/auth model** — define each vmauth user with bearer_token or username/password, and decide where auth terminates; map read-only consumers to /select/... prefixes and writers to /insert/... prefixes so a read token can never write and vice versa.

2. **Build precise url_map routing** — write url_map entries whose src_paths / src_hosts regexes are anchored and specific, routing query traffic to the vmselect pool and ingest to the vminsert pool, and pin each user's url_prefix so they cannot reach another tenant's accountID:projectID by editing the path.

3. **Load-balance and add resilience** — list multiple upstream url_prefix targets so vmauth round-robins across vmselect/vminsert replicas, and configure retry/backoff and -maxConcurrentRequests so a slow upstream doesn't stall the gateway.

4. **Enforce per-user limits** — apply max_concurrent_requests and rate limits per user (and via -maxConcurrentPerUserRequests) so one consumer can't monopolize the cluster; explain what vmauth limits vs what must be enforced downstream at vmselect/vminsert.

5. **Terminate TLS correctly** — configure -tls, cert/key (or mTLS with client CA), and confirm the hop from vmauth to the cluster isn't left as unprotected plaintext across a trust boundary; note HA (run 2+ vmauth behind an LB).

6. **Make reloads safe and observable** — set the -auth.config reload mechanism, and wire monitoring on vmauth_config_last_reload_successful, per-user request/error counters, and rate-limit rejections so a bad config or a runaway user is caught fast.

Output as: (a) auth/user model, (b) an annotated -auth.config with url_map and url_prefix, (c) TLS + HA topology, (d) per-user rate-limit table, (e) a validation checklist including a deliberately-wrong-tenant test and reload-failure alerting.

Bias toward least privilege and explicit tenant pinning; wherever a regex or url_prefix could let a user cross into another tenant or escalate from read to write, flag it and show the test that proves the boundary holds.

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.