Prometheus / VictoriaMetrics
What it gives you — the query_metrics and query_metrics_range tools: PromQL against any
backend that speaks the Prometheus HTTP API, including VictoriaMetrics. Plus alert_rule, which
reads the firing alert’s own rule expression so a threshold alert is judged against the series it
actually thresholds.
Minimal config
metrics:
url: http://vmsingle.observability.svc:8429Pinning the flavor instead of auto-detecting it:
metrics:
url: http://prometheus.observability.svc:9090
flavor: prometheus # or "victoriametrics" — optional, auto-detected when omittedVerify it locally
curl -s "http://vmsingle.observability.svc:8429/api/v1/query?query=up" | jq .statusThen fire a test incident and confirm query_metrics appears among the tools the model called:
kubectl -n runlore logs deploy/runlore | grep 'tool=query_metrics'Notes
- Presence enables it —
metrics.urlset is all it takes; an unset URL leaves the tool unregistered, no error. - Both Prometheus and VictoriaMetrics speak the same Prometheus HTTP API; VictoriaMetrics also
accepts MetricsQL, a PromQL superset.
metrics.flavorunlocks MetricsQL-only query guidance for the model — it is auto-detected at startup (DetectFlavorprobes/api/v1/status/buildinfo) and fails safe to generic Prometheus behaviour on an ambiguous or failed probe, so the model is never told to use a dialect the backend might reject. Pinflavor:explicitly when the backend sits behind a proxy that confuses the probe. alert_rulereads the rule, so the model stops guessing which series to check. A threshold alert names a metric and a statistic, and the two are easy to confuse: an alert onaws_rds_write_latency_maximum > 0.050is not answered by querying the_averageseries, which can sit near zero while the maximum spikes. The tool fetches the rule’s ownexprfrom/api/v1/rulesso the investigation reads the right series first. It also surfaces the rule’shealthandlastError— a rule that is not evaluating looks identical to a healthy metric sitting at zero.- It degrades, never fails. A backend with no rules endpoint, an HTTP error, an empty ruleset,
or an alertname with no matching rule all return an “unavailable” string rather than an error, so
a missing rules API can never abort an investigation or be misread as “this alert has no rule”.
When the name does not match, the reply lists the alertnames the backend does define, with the
closest matches first. Because a string is a successful tool call, each degraded outcome is
counted in
runlore_alert_rule_degraded_total— labelledsystemic(no rules endpoint, a failing read, an empty ruleset: this deployment has lost the tool entirely) orroutine(this alertname has no rule here). See Observability for the alert recipe. token_env(bearer auth) andheaders(e.g.X-Scope-OrgIDfor a multi-tenant backend) are available like every other data-source endpoint.headersvalues are not secret-safe over plain HTTP — usehttps://for a public host, or keep secrets intoken_envonly.
Reference
- Configuration → Other top-level keys
for the full
metricskey reference. - Data sources — the provider table across every signal.