Run a range query with curl
Get Prometheus data for a time range through the HTTP API
curl -sG 'http://prometheus:9090/api/v1/query_range' --data-urlencode 'query=rate(http_requests_total[5m])' --data-urlencode 'start=2024-01-01T00:00:00Z' --data-urlencode 'end=2024-01-01T01:00:00Z' --data-urlencode 'step=60s' | jq .
- tool
- prometheus30 commands
- tags
- prometheusmonitoring
More prometheus commands
-
promtool check rules rules.ymlCheck the syntax of Prometheus alerting and recording rule files
-
amtool silence add --alertmanager.url=http://alertmanager:9093 alertname=<name> --duration=2h --comment='Maintenance'Create a silence to stop alert notifications during maintenance
-
amtool silence query --alertmanager.url=http://alertmanager:9093Show all active silences in Alertmanager
-
amtool silence expire <id> --alertmanager.url=http://alertmanager:9093End an active silence right now
-
amtool check-config alertmanager.ymlValidate the Alertmanager configuration file