victoriametrics
БесплатноБез исполняемых скриптовНе проверенDeploy and configure VictoriaMetrics as a high-performance time-series database for metrics storage and querying. Use when a user needs a…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
VictoriaMetrics
Overview
Deploy VictoriaMetrics as a fast, cost-effective Prometheus-compatible time-series database. Covers single-node and cluster deployment, vmagent configuration, MetricsQL querying, and integration with Grafana and Prometheus.
Instructions
Task A: Deploy Single-Node VictoriaMetrics
# docker-compose.yml — Single-node VictoriaMetrics with vmagent and vmalert
services:
victoriametrics:
image: victoriametrics/victoria-metrics:v1.154.1
command:
- '-storageDataPath=/victoria-metrics-data'
- '-retentionPeriod=90d'
- '-httpListenAddr=:8428'
- '-search.maxUniqueTimeseries=1000000'
- '-dedup.minScrapeInterval=15s'
ports:
- "8428:8428"
volumes:
- vm_data:/victoria-metrics-data
vmagent:
image: victoriametrics/vmagent:v1.154.1
command:
- '-promscrape.config=/etc/vmagent/scrape.yml'
- '-remoteWrite.url=http://victoriametrics:8428/api/v1/write'
- '-remoteWrite.tmpDataPath=/vmagent-remotewrite-data'
volumes:
- ./vmagent-scrape.yml:/etc/vmagent/scrape.yml:ro
- vmagent_data:/vmagent-remotewrite-data
vmalert:
image: victoriametrics/vmalert:v1.154.1
command:
- '-datasource.url=http://victoriametrics:8428'
- '-remoteRead.url=http://victoriametrics:8428'
- '-remoteWrite.url=http://victoriametrics:8428'
- '-notifier.url=http://alertmanager:9093'
- '-rule=/etc/vmalert/rules/*.yml'
ports:
- "8880:8880"
volumes:
- ./alert-rules:/etc/vmalert/rules:ro
volumes:
vm_data:
vmagent_data:
Task B: Configure vmagent Scraping
# vmagent-scrape.yml — Scrape configuration (Prometheus-compatible)
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'node-exporter'
static_configs:
- targets: ['node-exporter:9100']
labels:
environment: production
- job_name: 'kubernetes-pods'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__meta_kubernetes_namespace]
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
target_label: pod
- job_name: 'app-services'
static_configs:
- targets:
- 'api-gateway:8080'
- 'payment-service:8080'
- 'order-service:8080'
metrics_path: /metrics
relabel_configs:
- source_labels: [__address__]
regex: '([^:]+):.*'
target_label: service
Task C: MetricsQL Queries
# Request rate per service (MetricsQL extends PromQL)
sum(rate(http_requests_total[5m])) by (service)
# P99 latency per service from histogram buckets (quantile_over_time is a rollup and takes no `by`)
histogram_quantile(0.99, sum(rate(http_request_duration_seconds_bucket[5m])) by (le, service))
# Top 5 services by error rate using MetricsQL's topk_avg
topk_avg(5, sum(rate(http_requests_total{status=~"5.."}[5m])) by (service)
/ sum(rate(http_requests_total[5m])) by (service))
# MetricsQL: running total over 24h (not available in standard PromQL)
running_sum(increase(http_requests_total{service="api-gateway"}[1h]))
# MetricsQL: range_median for smoother visualization
range_median(cpu_usage_percent{instance=~"web-.*"})
# Query via API
curl -s "http://localhost:8428/api/v1/query_range" \
--data-urlencode 'query=sum(rate(http_requests_total[5m])) by (service)' \
--data-urlencode 'start=-1h' \
--data-urlencode 'step=60s' | jq '.data.result[] | {service: .metric.service, values: (.values | length)}'
Task D: Alert Rules for vmalert
# alert-rules/service-alerts.yml — Alert rules for vmalert
groups:
- name: service-health
interval: 30s
rules:
- alert: HighErrorRate
expr: |
sum(rate(http_requests_total{status=~"5.."}[5m])) by (service)
/ sum(rate(http_requests_total[5m])) by (service) > 0.05
for: 5m
labels:
severity: critical
annotations:
summary: "Error rate above 5% on {{ $labels.service }}"
- alert: HighMemoryUsage
expr: |
(node_memory_MemTotal_bytes - node_memory_MemAvailable_bytes)
/ node_memory_MemTotal_bytes > 0.9
for: 10m
labels:
severity: warning
annotations:
summary: "Memory usage above 90% on {{ $labels.instance }}"
# Recording rule for dashboard performance
- record: service:request_rate:5m
expr: sum(rate(http_requests_total[5m])) by (service)
Task E: Cluster Mode Deployment
# docker-compose-cluster.yml — VictoriaMetrics cluster for horizontal scaling
service
Установить victoriametrics в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл victoriametrics?
Deploy and configure VictoriaMetrics as a high-performance time-series database for metrics storage and querying. Use when a user needs a Prometheus-compatible long-term storage backend, wants to write MetricsQL queries, configure vmagent for metrics scraping, or set up VictoriaMetrics cluster mode for horizontal scaling.
Как установить скилл victoriametrics?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл victoriametrics запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic