Skip to content

Instantly share code, notes, and snippets.

View polx's full-sized avatar

Paul Libbrecht polx

View GitHub Profile
# make a query at this point in time
$ promtool query instant http://localhost:9090 '{job=~".+"}'
up{instance="localhost:9090", job="prometheus"} => 1 @[1690724237.225]
go_memstats_alloc_bytes{instance="localhost:9090", job="prometheus"} => 29046776 @[1690724237.225]
...
# query a metric for the time range between two Unix timestamp
$ promtool query range --start 1690724700 --end 1690725307 --step 1m http://localhost:9090 \
'go_memstats_alloc_bytes{job="prometheus"}'
23215032 @[1690724700]