/grafana:metricsqlfrom grafana
VictoriaMetrics MetricsQL query language as a PromQL superset: rollup extensions, behavioral diffs (rate/increase semantics, implicit conversions, auto-aligned subqueries), label manipulation, WITH templates, and query API enhancements.
Ships in grafana. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
VictoriaMetrics PromQL superset. Syntactically backwards-compatible; semantically different for a subset of queries.
Lead with the diffs — that's where users get burned. PromQL fundamentals live in the sibling promql skill; this covers
only what PromQL doesn't.
${CLAUDE_SKILL_DIR}/references/behavioral-diffs.md]
rate/increase/delta/changes diffs, _prometheus-suffixed variants, scalar/instant-vector unification, NaN
handling, name retention, implicit conversions, auto-aligned subqueries, default_rollup lookback, staleness markers.${CLAUDE_SKILL_DIR}/references/extensions.md] Rollup family, WITH templates,
multiple-or filters, default/if/ifnot ops, group_left(*) prefix, keep_metric_names, [Ni] step, numeric
suffixes, aggregate limit N, boundsLabel, fractional durations, Graphite, multi-line.${CLAUDE_SKILL_DIR}/references/functions-catalog.md] All rollup, transform,
label-manipulation, aggregate functions by category, with PromQL/MetricsQL provenance.${CLAUDE_SKILL_DIR}/references/api-enhancements.md] extra_label, extra_filters[],
round_digits, limit, timestamp formats, stats response, cluster vmselect URL layout, multi-tenancy.Read the relevant reference before proceeding.
rate, increase, delta, changes differ._prometheus-suffixed variants give byte-parity: rate_prometheus, increase_prometheus, delta_prometheus,
changes_prometheus.vmselect (cluster) or single-node binary; exposed via standard /api/v1/query and
/api/v1/query_range.rate/increase use the last sample before the window for the first delta; Prometheus
doesn't. For increase(metric[$__interval]) on a slow counter, Prometheus loses one delta per window. Use
rate_prometheus/increase_prometheus for parity.increase() to integer thresholds.scalar(metric) coercion rarely needed; arithmetic on aggregation results works.(-1)^0.5 returns empty in MetricsQL; Prometheus returns a NaN series. Grafana renders identically;
programmatic consumers see different shapes.min_over_time(foo), round(foo), abs(foo) keep foo. Prometheus
strips.Full mechanics, edge cases, implicit-conversion pipeline, per-function table:
[${CLAUDE_SKILL_DIR}/references/behavioral-diffs.md].
Omitting [d] is allowed:
default_rollup and rate: max(step, scrape_interval) — prevents gaps when step < scrape_interval.step ($__interval in Grafana, 1i).rate(node_network_receive_bytes_total) ≡ rate(node_network_receive_bytes_total[$__interval]).Silent behavior change across panels with different steps. For alerting and recording rules, always specify the window explicitly.
VictoriaMetrics rewrites every query before evaluation (unless -search.disableImplicitConversion):
default_rollup: foo → default_rollup(foo).abs(temperature) → abs(default_rollup(temperature)),
count(up) → count(default_rollup(up)).rate(sum(up)) → rate((sum(default_rollup(up)))[1i:1i]).1i: avg_over_time(rate(m[5m])[1h]) → avg_over_time(rate(m[5m])[1h:1i]).When debugging, mentally apply these first — the actual computation may differ from what was typed.
Full conversion list with disable flags: [${CLAUDE_SKILL_DIR}/references/behavioral-diffs.md].
rollup(m[d]) — min/max/avg with rollup="..." label.rollup_rate(m[d]) — per-second rate min/max/avg over adjacent samples; better than irate for spike detection.rollup_increase(m[d]) / rollup_delta(m[d]) / rollup_deriv(m[d]) — same pattern.rollup_candlestick(m[d]) — OHLC.aggr_over_time(("func1","func2",...), m[d]) — multiple rollups in one pass.Pair with keep_metric_names to preserve the original name.
Functions and binary ops strip the metric name. This causes duplicate time series errors when distinct names collapse
into the same label set. Suffix with keep_metric_names:
rate({__name__=~"foo|bar"}) keep_metric_names({__name__=~"foo|bar"} / 10) keep_metric_namesAvailable on all rollups, transforms, and binary operators.
or in Series SelectorsPromQL {env="prod",job="a"} is a single AND. MetricsQL adds top-level disjunction:
{env="prod",job="a" or env="dev",job="b"}
Each or-group is an AND of matchers. Compose with comma within a group.
Multi-constant matching: status_code == (300, 301, 304) returns series where status_code is any listed value.
Reusable named subexpressions:
WITH (
errs = rate(http_requests_total{status=~"5.."}[5m]),
total = rate(http_requests_total[5m]),
)
sum(errs) by (job) / sum(total) by (job)
String concat: WITH (commonPrefix="my_app_") {__name__=commonPrefix+"errors_total"}. Expanded at parse time.
q1 default q2 — fills gaps in q1 from q2.q1 if q2 — keeps q1 where q2 has a value (conditional masking).q1 ifnot q2 — keeps q1 where q2 has no value (inverse).Compose with default-on-missing: (up{job="x"} default 0) == 0 reliably alerts on disappearing targets.
kube_pod_info * on(namespace) group_left(*) prefix "ns_" kube_namespace_labels
Copies all labels from right side except those in on(...), prefixed with ns_. group_right(*) mirrors. Without
prefix, collisions error.
limit Nsum(http_requests_total) by (path) limit 10
Returns 10 paths total. Other series dropped silently. Distinct from topk(10, ...): limit N is order-arbitrary;
topk keeps the top by value.
$__interval and [Ni] Syntax1i = one step (Grafana step arg).[10i] = lookbehind covering ten steps.offset 5i = shift back five steps.rate(metric[10i] offset 5i).http://<vmselect>:8481/select/<accountID>/prometheus/api/v1/query
http://<vmselect>:8481/select/<accountID>/prometheus/api/v1/query_range
<accountID> is accountID or accountID:projectID (32-bit ints). Single-node uses unprefixed /api/v1/query.
/prometheus/ prefix is optional but explicit.
Full URL layout (ingestion, federation, Graphite, vmstorage admin, vmalert proxy):
[${CLAUDE_SKILL_DIR}/references/api-enhancements.md].
extra_label=<name>=<value> — adds {name="value"} to every selector. Repeatable. Used by auth proxies for
tenant scoping.extra_filters[]=<selector> — adds a full selector with regex support: extra_filters[]={env=~"prod|staging"}.round_digits=N — rounds response values to N decimals.limit=N on /api/v1/labels, /api/v1/label/<name>/values, /api/v1/series.Responses include stats with executionTimeMsec and seriesFetched. seriesFetched is approximate; vmalert uses it
to flag never-firing rules.
1_234_567_890 ≡ 12345678908K (8000), 1.2Mi (1.2×1024²), supports K Ki M Mi G Gi T Ti[1.5m], offset 0.5d[300] is seconds: rate(m[300] offset 1800) ≡ rate(m[5m]) offset 30msum_over_time(m[1h]) / 1h ≡ sum_over_time(m[1h]) / 3600m{foo="bar",}, f(a, b,), WITH (x=y,) x all valid. Use in multi-line queries.ტემპერატურა{πόλη="Київ"} is validfoo\-bar{baz\=aa="b"}, \xXX, \uXXXX@ modifier anywhere — sum(foo) @ end(), foo @ (end() - 1h)histogram_quantile(phi, buckets, boundsLabel?) — optional third arg returns lower/upper bounds in boundsLabel.
For plotting quantile confidence intervals.
histogram_over_time(gauge[d]) produces VictoriaMetrics-format histograms from gauge values:
histogram_quantile(0.5, sum(histogram_over_time(temperature[24h])) by (vmrange,country))
Computes quantiles over gauge distributions without re-instrumenting.
When writing:
$__interval is appropriate. Otherwise use [5m] or [Ni] explicitly.default over or vector(0) — more readable, handles labels correctly.rollup_rate for counter spike detection over irate — min/max/avg in one query.When migrating from Prometheus:
increase() to integer thresholds — exact integers may fire differently.*_prometheus variants only when byte-parity is required (cross-backend SLO consistency).-search.logImplicitConversion to see rewrites.When reviewing:
rate(sum(...)) — silent subquery formation.default_rollup wrap.promql — shared fundamentals (selectors, operators, aggregations, vector matching). This skill — MetricsQL extensions and diffs.
prometheus — instrumentation; this skill — query-time behavior.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
victoriametrics, metricsql, promql, query-language, monitoring
7 skills in this plugin
/alertingGrafana unified alerting: rule types, evaluation lifecycle, state transitions, notification policies, contact points, silences, mute timings, recording rules, and alert/notification templates. Invoke whenever task involves any interaction with Grafana alerting — creating or editing alert rules, configuring contact points and routing, templating annotations or notifications, debugging alert state, or reviewing alerting configuration./dashboardsGrafana dashboard authoring: JSON model (Classic and V2), panel types and selection, standard options, thresholds, value mappings, field overrides, transformations, variables (query/custom/interval/filter), repeating panels and rows, annotations, dashboard/panel/data links, and library panels. Invoke whenever task involves any interaction with Grafana dashboards — creating, editing, reviewing, debugging, or understanding dashboard configuration./datavizData visualization discipline for monitoring and observability dashboards: chart-type selection by data shape, encoding accuracy hierarchy (position > length > angle > area > color), pre-attentive attributes, Tufte data-ink, color theory (semantic conventions, Viridis, colorblind safety), dashboard layout and information hierarchy (F/Z-pattern, tiering), time-series conventions (baseline, interpolation, dual axes, stacking), observability frameworks (RED, USE, Four Golden Signals, SLO/SLI). Invoke whenever task involves any interaction with dashboard design quality — making a good dashboard, reviewing a visualization, picking a chart type, dashboard layout, color choices, panel arrangement, or critiquing existing observability dashboards./logsqlVictoriaLogs LogsQL query language: filters (word, phrase, prefix, regexp, range, IPv4 range, exact, stream, time), pipe operators (stats, sort, fields, format, extract, unpack_json, unpack_logfmt, math, limit, top, uniq), stats functions, log stream filtering with Prometheus-style label selectors, field extraction, and performance patterns. Invoke whenever task involves any interaction with LogsQL — writing, debugging, optimizing, or reviewing VictoriaLogs queries./promqlPromQL query writing: selectors, operators, vector matching, functions, aggregations, histograms, subqueries, recording rules, alerting rules, and query optimization. Invoke whenever task involves any interaction with PromQL — writing, debugging, optimizing, reviewing, or explaining Prometheus queries for dashboards, alerts, recording rules, or ad-hoc exploration./provisioningGrafana provisioning across all delivery methods: file provisioning YAML (datasources, dashboards, alerting), Kubernetes-style HTTP API, gcx CLI (replacing grafanactl), Terraform provider, Foundation SDK, Git Sync. Invoke whenever task involves any interaction with Grafana provisioning or observability-as-code — configuring datasources, managing dashboards or alerting resources as code, automating Grafana setup, choosing between IaC tools, migrating between approaches, or using the Grafana HTTP API.npx claudepluginhub xobotyi/cc-foundry --plugin grafanaOther plugins' skills for the same job