Belajar Sendiri

Monitoring & Observability commands

One page per command. What it does, when to use it, how risky it is.

Check rules and configs

  • promtool check configChecks prometheus.yml, and the rule files it names, before you load them.Risk: Safe
  • promtool check rulesChecks a rule file: the YAML, every expr, and every name.Risk: Safe
  • amtool check-configChecks an Alertmanager config and lists what it found: routes, receivers, inhibit rules.Risk: Safe

Ask Prometheus

  • curlAsks Prometheus if it is ready to answer queries.Risk: Safe
  • curlReads a target's numbers as plain text, the same page Prometheus scrapes.Risk: Safe
  • curlAsks blackbox exporter to knock on a URL once and report what happened.Risk: Safe
  • curlRuns a PromQL query through Prometheus's HTTP API and prints the answer as JSON.Risk: Safe
  • promtool query instantRuns one PromQL query against a server and prints one line per series.Risk: Safe

Alerts and silences

Logs and traces

  • logcli queryAsks Loki a LogQL question from the terminal and prints the matching diary lines.Risk: Safe
  • otelcol-contrib validateChecks an OpenTelemetry Collector config without starting it. No output means it is fine.Risk: Safe