only export response times on up monitors
This commit is contained in:
parent
abf87db604
commit
b875ef4443
1 changed files with 7 additions and 6 deletions
13
exporter.py
13
exporter.py
|
@ -29,12 +29,13 @@ def format_prometheus(data):
|
||||||
item.get('url'),
|
item.get('url'),
|
||||||
1 if item.get('status', 0) == 2 else 0,
|
1 if item.get('status', 0) == 2 else 0,
|
||||||
)
|
)
|
||||||
result += 'uptimerobot_response_time{{name="{}",type="{}",url="{}"}} {}\n'.format(
|
if item.get('status', 0) == 2:
|
||||||
item.get('friendly_name'),
|
result += 'uptimerobot_response_time{{name="{}",type="{}",url="{}"}} {}\n'.format(
|
||||||
item.get('type'),
|
item.get('friendly_name'),
|
||||||
item.get('url'),
|
item.get('type'),
|
||||||
item.get('response_times').pop().get('value'),
|
item.get('url'),
|
||||||
)
|
item.get('response_times').pop().get('value'),
|
||||||
|
)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue