1
votes

Just started dating with Prometheus monitoring system.

Maked API request to get by name metric node_filesystem_avail

http://server01:9090/api/v1/query_range?query=node_filesystem_avail&start=1513255115&end=1513258715&step=60

Request returned information about all Target Instances:

{"status":"success","data":{"resultType":"matrix","result":[{"metric":{"name":"node_filesystem_avail","device":"/dev/mapper/INTVG-homevol","fstype":"ext4","instance":"server01:9100","job":"node_exporter_metrics","mountpoint":"/home"},"values":[[1513255295,"41150836736"],[1513255355,"41150836736"],[1513255415,"41150836736"],[1513255475,"41150836736"],[1513255535,"41150836736"],[1513255595,"41150836736"],[1513255655,"41150836736"],[1513255715,"41150836736"],[1513255775,"41150836736"],[1513255835,"41150836736"],[1513255895,"41150836736"],[1513255955,"41150836736"],[1513256015,"41150836736"],[1513256075,"41150836736"],[1513256135,"41150836736"],[1513256195,"41150836736"],[1513256255,"41150836736"],[1513256315,"41150836736"],[1513256375,"41150836736"],[1513256435,"41150828544"],[1513256495,"41150824448"],[1513256555,"41150824448"],[1513256615,"41150824448"],[1513256675,"41150824448"],[1513256735,"41150824448"],[1513256795,"41150824448"],[1513256855,"41150824448"],[1513256915,"41150824448"],[1513256975,"41150824448"],[1513257035,"41150824448"],[1513257095,"41150824448"],[1513257155,"41150824448"],[1513257215,"41150824448"],[1513257275,"41150824448"],[1513257335,"41150824448"],[1513257395,"41150824448"],[1513257455,"41150824448"],[1513257515,"41150824448"],[1513257575,"41150824448"],[1513257635,"41150824448"],[1513257695,"41150824448"],[1513257755,"41150824448"],[1513257815,"41150824448"],[1513257875,"41150824448"],[1513257935,"41150824448"],[1513257995,"41150824448"],[1513258055,"41150820352"],[1513258115,"41150820352"],[1513258175,"41150820352"],[1513258235,"41150820352"],[1513258295,"41150820352"],[1513258355,"41150820352"],[1513258415,"41150808064"],[1513258475,"41150808064"],[1513258535,"41150808064"],[1513258595,"41150808064"],[1513258655,"41150808064"],[1513258715,"41150808064"]]},{"metric":{"name":"node_filesystem_avail","device":"/dev/mapper/INTVG-homevol","fstype":"ext4","instance":"server02:9100","job":"prometheus","mountpoint":"/home"},"values":[[1513255115,"20755623936"],[1513255175,"20755623936"],[1513255235,"20755623936"],[1513255295,"20755623936"],[1513255355,"20755623936"],[1513255415,"20755623936"],[1513255475,"20755623936"],[1513255535,"20755623936"],[1513255595,"20755623936"],[1513255655,"20755623936"],[1513255715,"20755623936"],[1513255775,"20755623936"],[1513255835,"20755623936"],[1513255895,"20755623936"],[1513255955,"20755623936"],[1513256015,"20755623936"],[1513256075,"20755623936"],[1513256135,"20755623936"],[1513256195,"20755623936"],[1513256255,"20755623936"],[1513256315,"20755623936"],[1513256375,"20755623936"],[1513256435,"20755623936"],[1513256495,"20755623936"],[1513256555,"20755623936"],[1513256615,"20755623936"],[1513256675,"20755623936"],[1513256735,"20755623936"],[1513256795,"20755623936"],[1513256855,"20755623936"],[1513256915,"20755623936"],[1513256975,"20755623936"],[1513257035,"20755623936"],[1513257095,"20755623936"],[1513257155,"20755623936"],[1513257215,"20755623936"],[1513257275,"20755623936"],[1513257335,"20755623936"],[1513257395,"20755623936"],[1513257455,"20755623936"],[1513257515,"20755623936"],[1513257575,"20755623936"],[1513257635,"20755623936"],[1513257695,"20755623936"],[1513257755,"20755623936"],[1513257815,"20755623936"],[1513257875,"20755623936"],[1513257935,"20755623936"],[1513257995,"20755623936"],[1513258055,"20755623936"],[1513258115,"20755623936"],[1513258175,"20755623936"],[1513258235,"20755623936"],[1513258295,"20755623936"],[1513258355,"20755623936"],[1513258415,"20755623936"],[1513258475,"20755623936"],[1513258535,"20755623936"],[1513258595,"20755623936"],[1513258655,"20755623936"],[1513258715,"20755623936"]]}}}

Good, BUT how get values metrics only one instance?

1

1 Answers

0
votes

Using query_range:

http://server01:9090/api/v1/query_range?query=up{instance="server01:9100"}&start=2017-12-15T11:10:30.781Z&end=2017-12-15T11:17:00.781Z&step=15s