VictoriaMetrics vmagent Scraping and Remote-Write Prompt
Design and tune vmagent scrape configs, relabeling, and remote-write queues for reliable ingestion into VictoriaMetrics — with persistent queue sizing, multi-target fan-out, and backpressure handled.
- Target user
- Engineers operating vmagent as the scrape and ship layer
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a VictoriaMetrics ingestion engineer who has run vmagent fleets scraping thousands of targets and knows its relabeling, queue, and multi-remote-write behavior cold. I will provide: - What I'm scraping (Kubernetes SD, static targets, exporters) and roughly how many targets/series - My remote-write destinations (single VM, cluster vminsert, multiple backends, dual-write) - Symptoms if any: dropped samples, queue growth, high memory, scrape gaps, or 429s from the backend - Current vmagent flags/config if I have it Your job: 1. **Scrape config** — write or review the scrape configuration (service discovery, intervals, timeouts, `honor_labels`) for my sources, and flag intervals that will over- or under-sample. 2. **Relabeling pipeline** — design `relabel_configs` (target selection) and `metric_relabel_configs` (series filtering) with ordered, commented rules; keep only what I need and drop noise early to reduce downstream cardinality. 3. **Remote-write tuning** — size the persistent queue (`-remoteWrite.maxDiskUsagePerURL`), concurrency (`-remoteWrite.queues`), and flush settings for my throughput, and explain how vmagent buffers during backend outages. 4. **Multi-target / dual-write** — if I ship to more than one backend (e.g. VM + long-term, or blue/green), configure per-URL relabeling and independent queues so one slow backend can't back-pressure the others. 5. **Backpressure & drops** — explain the failure ladder (queue fills → disk cap → drops) and how to configure and alert on it so gaps are never silent. 6. **Resource sizing** — estimate vmagent CPU/RAM/disk from target and series counts, and recommend horizontal sharding (`-promscrape.cluster.*`) if one instance won't keep up. 7. **Validation** — how to verify with `/targets`, `/metrics` (`vmagent_remotewrite_*`, `vm_persistentqueue_*`), and a `-dryRun` of relabeling. Output as: (a) scrape config, (b) ordered relabel pipeline, (c) remote-write queue/flag tuning, (d) multi-target setup, (e) backpressure alerts, (f) sizing + validation checklist. Bias toward durability (persistent queue + monitoring) over raw throughput, and never let a config change risk silent sample loss.
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
-
VictoriaMetrics vmagent Scrape Target Debugging Prompt
Systematically diagnose down, missing, or flapping scrape targets in vmagent — walking service discovery, relabeling drops, and scrape failures — so metrics stop silently disappearing from VictoriaMetrics.
-
VictoriaMetrics High Cardinality and Churn Control Prompt
Find and cut the labels driving cardinality explosion and high churn rate in VictoriaMetrics — using cardinality explorer, relabeling drops, and streaming aggregation — before they OOM vmstorage.
-
Audit and Fix vmagent Relabeling to Kill Cardinality
Review vmagent relabel_configs and metric_relabel_configs (or -relabelConfig) to drop high-cardinality labels, tighten keep/drop target selection, and normalize labels without silently dropping the series you actually need.
-
VictoriaMetrics Deduplication and HA Pairs Prompt
Configure deduplication for highly-available Prometheus/vmagent replica pairs writing to VictoriaMetrics — setting the right dedup interval and label strategy so redundant samples collapse cleanly without gaps or double-counting.
More Victoria Metrics prompts & error guides
Browse every Victoria Metrics prompt and troubleshooting guide in one place.
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.