Belajar Sendiri

Commands

promtool query instant

promtool query instant <server> '<PromQL>'

Risk: Safe

What it does

Runs one PromQL query against a server and prints one line per series.

When to use it

To try a query in the terminal, without the web page.

Example

$ docker compose exec prometheus promtool query instant http://localhost:9090 'up'

Each target, with 1 for up and 0 for down.