Documentation menu

Docs Connections: Prometheus

Ask Prometheus

Attach a connection and ask. You name the service or host, the time and what you want; Verbiqo chooses the jobs, hosts, metrics and queries from its local map, and answers from what it measured.

Get good answers: read this first.

  1. Index the server once. Build Index in the app (or verbiqo prom index-build <name>) reads every job, host and metric into a local map. Choose the built-in model or your organization’s embedding service first, so the index also finds metrics by meaning (disk usage finds node_filesystem_avail_bytes); only metric names and descriptions are embedded, never values. On a very large server, index just the jobs you ask about with Refresh technology (or verbiqo prom index-refresh <name> --jobs mysql,node). Check it with verbiqo prom index-status <name>. Details: the local map and the semantic index.
  2. Name the service, job or technology. find any down mysql, was orders-db down in the last 24 hours? Verbiqo reads only what a question names, so one question never loads every job of a large server. Is anything down? names nothing and reads nothing.
  3. For one machine, name the host on its own. check memory and disk on db-1, how was CPU on db-1 over the last six hours? A question that names a job and a host reads the whole job.
  4. Give the time. over the last six hours, yesterday, 48h, up to 7 days. There is no default range: a first question with no time is read at the current moment only (the last few minutes), so any issues with mysql on its own looks at right now and checks such as restarts do not run. A follow-up with no time continues the window of the one before. A range such as between 1 Oct and 4 Oct is one period, read whole.
  5. Not sure of the name? Ask list mysql jobs or list targets first; no model is used and nothing is measured (every list you can ask for).
  6. To move to another service, ask a whole question naming it: any issues with orders-db yesterday? A short follow-up such as what about orders-db? can stay on the previous service.
  7. Pick the kind of question. Any issues with mysql yesterday is an investigation and runs every check (Prometheus checks). How was CPU on mysql runs only what it names, so it is quicker and lighter on the server.

Attach

/prom prod

Use the name you gave the connection. /prom off stops reading it; /sources shows what is attached.

What to ask

You wantAsk
A measurementHow was CPU on the MySQL servers over the last six hours?
A peakWhat was the highest memory use on db01 yesterday?
A causeWhy did the payments service slow down yesterday afternoon?
Current stateFind any down mysql or Was orders-db down in the last 24 hours?

Name the service, job or technology. Verbiqo reads only the jobs a question names, so one question never loads every job of a large server; a question that names none, such as is anything down?, is answered with Subject not recognised and reads nothing.

When Verbiqo’s own reading cannot place the time or the subject, such as a short host name or this week than last week, your model reads the question once. Verbiqo then checks that the job or host is written in your question and exists, and works out the dates itself; the model never computes a date. If a check fails, the question is refused as before.

Name the service or host, the time, and whether you want a measurement or a cause. How to phrase a question and what happens when Verbiqo asks you something: Ask about your systems. How a Prometheus investigation reads: below.

Prometheus also answers alongside a database or cluster: attach /pg, /mysql, /mssql, /redis or /k8s with it, and the machine’s history, reboots and capacity forecasts join that system’s answer and timeline.

Lists

Why it helps: the quickest way to see what the server holds and to learn the exact names to ask about. A list is one light read, written by code; no model is used.

You wantAskNarrow it
Technologies (exporters) and their jobslist technologies 
Jobslist jobslist mysql jobs, list jobs related to mysql (found by the metrics a job exposes, not its name)
Targets, with health and last errorlist targetslist targets mysql; state: list down targets (up, down, unknown)
Alerts firing or pending nowlist alertslist alerts mysql, list alerts severity=critical; state: list firing alerts (firing, pending, silenced, inhibited)
Alerting and recording ruleslist ruleslist rules mysql, what are the rules for galera?; state: firing, pending, inactive
Metric nameslist metricslist metrics mysql
Alertmanager silenceslist silenceslist expired silences, list all silences (active, pending, expired); needs the Alertmanager URL on the connection
Alertmanagerslist alertmanagersThe ones Prometheus reports, and the one attached to the connection
  • Words that narrow: a keyword is found in names, label values and annotations, in any case, and a technology word finds its other names (mysql also finds mariadb and mysqld). label=value keeps matching rows, label!=value drops them, and several are all required. Quote a phrase to keep it whole. all lifts the usual 40 rows to 500.
  • Start with list, show, display or what are. A time in the question (yesterday, in the last hour) makes it a measurement question instead of a list.
  • Explain alerts: explain alerts or explain the firing alerts lists them and adds the model’s explanation under the list, which is checked; the list itself stands as read.

Follow-up questions

  • Same time: a question with no time, or one that says the same time, then or during that outage, reads the window of the question before.
  • Same subject: what could be the cause? after find any down mysql looks at the services that were down.
  • Names: words a job writes together are found either way: mysql router finds monitoring-analytics-mysqlrouter. A name that matches no job is said at the end of the answer, with what was used instead.

Counts, busiest hour, uptime, time until full and comparisons

Five kinds of question get a figure that Verbiqo computes itself, from Prometheus’s own functions. The model does not write a number.

  • How many times something happened: how many queries did db1.example.com run last week? The answer is the rise of the counter over that period. A restart does not lower it. With no period, it gives the running total since the last restart, said as that, and the rise over the last 24 hours.
  • The busiest or quietest hour: what hour of the day is db1.example.com busiest? The answer is the hour of the day (UTC) with the highest or lowest median over the days read, and the next busiest. With no period it reads the last 7 days. If the hours are within 5% of each other, it says none stands out.
  • Uptime: what was the uptime of db1.example.com over the last 7 days? The answer is the share of scrapes that read the service as up, with each down span.
  • Time until something is full: how long until the disk on web-01 runs out? The answer is the days left at the current rate of growth, with the date and how well a straight line fits.
  • One period against another: is web-01 slower this week than last week? or compare disk usage on web-01 between 16 Nov and 18 Nov. Each period is read the same way, and the answer says which is higher and by how much. A difference under 5% is not reported as one. If one period is longer, it is cut to the length of the other, and the answer says so.

Two dates alone are one period, not two days: any anomalies between 1 Oct and 4 Oct reads 1 to 4 Oct. Add compare to compare them.

When a figure cannot be computed, the answer says why instead of guessing:

  • No data before a date: the server holds nothing for the subject in the period, and the answer gives the time of its first sample. That says what the server holds, not that the service was down.
  • Not growing: a series that does not rise over the period has no time until full.
  • Not a straight line: growth that falls back, as a clean-up does, is not projected as a date. The answer says so, and adds when the poor fit would reach full, for what it is worth.

If no figure can be built for the metric, the question is answered as any other measurement question.

How to read the answer

An investigation, such as any issues with mysql yesterday, is written in the same order every time. Verbiqo states every figure, time and state itself, from what it measured; the model only suggests the likely cause, what it means and the next checks.

  • Answer. One or two sentences with the most important finding and its time: an outage with its restarts, a limit reached, a disk or other resource due to fill within 7 days, or the change your question asks about. A question about one measurement, such as CPU, leads with that measurement.
  • What happened. A table in time order: Time (UTC), Host, Event and Source, the metric the row was read from. It holds about 12 rows; the rest are counted and listed whole in the details.
  • Problems. Numbered by impact: hosts down or restarted first, then limits reached, then resources due to fill within 7 days, then changes that lasted, then brief ones. Each has its headline in bold and one Check: line that only reads. A problem in the measurement you asked about comes first in its group.
  • The model’s reading. The likely cause, what it likely means, next steps that only read, and what the measurements do not show. This is your model’s inference, not a measurement, and Verbiqo’s notes in brackets are its checks of it.
  • Minor. How many other episodes and small events were measured; each is listed whole in the details.
  • Normal. What stayed inside its usual band the whole time asked about.
  • Not checked. What Verbiqo did not measure, and why.

A reading that stays above 90% of its limit for the whole time asked about is said as that, with its usual and highest values, never as a limit reached at one moment. A value that only records the highest level seen, such as max used connections, and never falls in the time asked about, is not reported as a limit.

The details

In the app, What this rests on under the answer opens the details; in a terminal they follow the answer under Details. They hold the whole investigation, in this order, and nothing the answer left out is lost there:

  • Headline. The most important finding, with its time and date: an outage, a restart, a limit reached, or the change your question asks about.
  • Likely cause (model, from the measured order). Two or three sentences by your model, citing the anomalies by their ids (A1, A2 and so on). Verbiqo checks every sentence and adds a note in brackets when one names a host, time or figure without citing an anomaly, gives a figure or time that is not in the lines it cites, puts a cause after its effect, or blames a cause from another moment that nothing measured links to the effect. No sentence is removed. If the model wrote none, the answer says so.
  • Anomalies (UTC). Every measured change that matters, by moment and by host, described below.
  • Also measured. Facts that are no event: a reading at its limit all the time asked about, a daily recurrence, and the comparison with a week earlier.
  • Not read. What Verbiqo did not measure, and why: reads not run because the limit of 24 queries for one question was reached, or a read the server refused. Verbiqo’s own checks run first (whether each service and host was up, restarts, how busy it was, what should be zero, and what reached a limit), so the limit cuts the model’s own additions first.
  • What it likely means (model) and Next steps (read-only). The model’s answer to your question in a sentence or two, and up to three checks that only read.
  • What the measurements do not show. What the model says the measurements cannot settle.
  • Unaffected. What stayed inside its usual band the whole time asked about; the first 8 are named, the rest counted.
  • Notes (Verbiqo’s, not the model’s). Every bracketed note about the model’s sentences, once each.
  • Also in the details. How many other episodes and small events the details hold.

Below a rule, Details (what the lines above rest on) holds the rest, and nothing the answer left out is lost there: the changes left out as routine for their series, or an alert that did not go to firing, each with the reason; every anomaly with its id; the model’s explanation of the other episodes; the verdict in full; each episode in full; and every finding (F1, F2 and so on). The queries are in Activity.

What counts as an anomaly

A change counts when it is any of these:

  • 3 times its usual level or more, or a third of it or less;
  • a percentage that moves 20 points or more;
  • a reading that crosses a limit: 90% of a share, or a load of 1 per CPU core;
  • a step to a new level that lasts, by the same amounts;
  • an outage, a restart, a counter that resets or a target that goes silent.

A change does not count when it is tiny next to the largest reading of that measurement in the time asked about, when the series makes it 5 or more times in that time at least half as big (it is listed in Details as routine), or when an alert only went to pending. A lasting change in what your question asks about, such as CPU, is always shown, and so is a spike of it that reaches 2 times its usual level.

How the list is laid out

  • By moment, then by host. One line per host; hosts that changed the same way share a line, with ranges. The moment of the headline is marked >.
  • Outages and restarts first. Then before it: the changes on that host in the 6 hours before, so the build-up is never left out. Then limits, then the largest changes.
  • Repeats said once. A limit crossed many times is one line (at the limit 17 times between 00:02 and 22:07), and over several days a change at the same time every day is one line.
  • The rest counted. In a moment with an outage, restart, limit or counter reset, the other changes stay in that moment as one line (and 4 other changes on 3 hosts in this window), with their ids. In any other moment only the hosts with a limit, a change of 10 times usual or more (or 40 points), or a change in what you asked about get a line. The moments left are counted on the last line, each in Details with its id. Moments beyond the 8 largest shown in full are one compact line each.

The answer, as a terminal prints it. The app draws the headings and the table.

## Answer
1 host had its target not scraped: app-1 18 Nov 04:30-04:35 UTC (5 min). It forms one incident
from 18 Nov 04:25 to 04:35 UTC (10 min).

## What happened

| Time (UTC) | Host | Event | Source |
| --- | --- | --- | --- |
| 18 Nov 04:25 | all 3 mysql hosts | disk space used from about 17% to about 20% at 18 Nov 04:25, held to the end of the window (2 days) | node_filesystem_size_bytes |
| 18 Nov 04:30-04:35 | app-1 | target down (its metrics stopped 18 Nov 04:25-04:35) | up, node_load1 |
| 19 Nov 14:30-14:35 | all 3 mysql hosts | CPU busy from about 0.07-1.7% to about 100% at 19 Nov 14:35, held to the end of the window (14 h 15 min) | node_cpu_seconds_total |

33 more events are listed whole under Details.

## Problems

1. **app-1: target down 04:30-04:35 UTC (5 min).** In the same incident on other hosts: 18 Nov 04:25 UTC
   all 3 mysql hosts: disk space used from about 17% to about 20% at 18 Nov 04:25, held to the end of
   the window (2 days). Check: the service error log and the host's kernel log on app-1 around
   04:30 UTC (read-only).
2. **14:30 UTC, all 3 mysql hosts: CPU busy from about 0.07-1.7% to about 100% at 19 Nov 14:35, held to
   the end of the window (14 h 15 min).** Check: cpu seconds, context switches and load5 on app-1,
   db-1 and db-2 around 14:30 UTC (read-only).

## The model's reading

The model's reading of the measurements above: its inference, not a measurement. The [Verbiqo: ...]
notes are Verbiqo's checks of it.

Likely cause (model, from the measured order):
  Disk use on all three hosts rose at 04:25 (A1), five minutes before app-1 stopped being
  scraped (A2).

Next steps (read-only)
- Check the kernel log on app-1 around 04:30 UTC.

## Minor

15 other episodes and 77 small events outside the ones above (the same counts as under Details),
listed whole there.

## Normal

Held inside their usual band all window: disk busy, network drops, network errors and 10 more.

## Not checked

- Not read: 2 measurements (Not run: the 24-query ceiling for one question was reached.)

The details read like this, here from another investigation:

db-2: disk busy at the limit from 20:52 and the mysql service down 22:00-22:04 UTC (10 Nov).

Likely cause (model, from the measured order):
  A connection surge through the routers (A1) drove threads running on db-2
  to 3,500 (A4) and its disk to the limit (A3); the service then stopped
  answering (A2).

Anomalies (UTC)
  > 20:45-22:04
    7 of 8 router hosts: active connections 1 -> 300 (A1)
    db-2: mysql service down 22:00-22:04 (A2); before it: disk busy at the limit (96%) (A3),
        threads running 10 -> 3,500 (A4)
    db-1 and db-3: disk busy 45% -> 0.02-0.04% (A5)
  3 other anomalies at 2 other moments, each in the details with its id (A6-A8)

Not read: 2 reads not run (the 24-query limit for one question was reached): the week-earlier
comparison for threads running and open files.

What it likely means (model)
  db-2 stopped answering after a connection surge.

Next steps (read-only)
- Check the connection limit on the mysql service of db-2.

Unaffected (held inside their usual band all window): replication lag, slow queries.

Also in the details: 0 other episodes and 3 small events.

From a terminal

In verbiqo chat, attach with /prom as in the app, or name the connection when you start: verbiqo chat --prom prod "find any down mysql". Ask list mysql jobs, list jobs related to mysql, list targets, list alerts, list rules or list metrics for a read-only Markdown inventory table. The verbiqo prom commands below need no chat session; run, query, range and describe need no model either.

verbiqo prom ask prod "why was mysql down yesterday"
verbiqo prom run prod targets
verbiqo prom jobs prod --match '^mysql'
verbiqo prom alerts prod
verbiqo prom query prod "sum by (job) (up)"
verbiqo prom range prod "sum(rate(node_cpu_seconds_total[5m]))" --minutes 60 --step 60
verbiqo prom describe prod
CommandDoes
ask <name> "<question>"The same investigation as the app, printing each step as it happens. --quiet prints only the answer; --json adds the queries, coverage and any unsupported figures.
run <name> <report>One of the fixed reports below.
query <name> "<PromQL>"One instant query, within the same guards as a question.
range <name> "<PromQL>" [--minutes 60] [--step 60]One range query ending now, over the last --minutes, at --step seconds.
describe <name>Version, number of series, and the ten metrics with the most series.
jobs|targets|alerts|rules|metrics <name> [--match <regex>] [--limit 1..100]Model-free inventory tables. The regex filters names already returned by Prometheus; each table says how many rows it shows out of the total and suggests a narrower match when needed.

Connection and map commands (add, test, index-*, cache-*) are on Set up Prometheus.

Reports for run

Fixed expressions for the questions people ask a server before they know what to ask it. No model is involved.

ReportShows
targetsWhich scrape targets are down.
scrape-durationThe ten slowest scrapes, which is usually what breaks first.
cardinalityHow many series each job contributes.
rule-failuresRecording and alerting rules that are failing to evaluate.
ingestionSamples being appended per second.

Something missing or unclear? Email hello@verbiqo.app.