lekpamartin / uptimerobot_exporter Goto Github PK
View Code? Open in Web Editor NEWExpose uptimerobot.com metrics for prometheus and visualize it in Grafana
License: Apache License 2.0
Expose uptimerobot.com metrics for prometheus and visualize it in Grafana
License: Apache License 2.0
not sure if you realize but the docker image is out of date. Or is it no longer supported?
One challenge with using this to alert on outages is that polling the API will fail when there is an internet outage, and we generally won't have a record of it because we are only capturing the 'current state' of the monitors.
It would be great if we could leverage the logs
feature of the getMonitors
endpoint to capture past or missed outages.
There is an example implementation of this approach in a javascript solution which leverages influxdb instead of prometheus.
Is such a thing even possible with prometheus style metrics collection? It would be great if we could persist outage information as well as the other metrics.
Hi,
Could a license be added to this repository? Right now we can't use this code because of it missing a license.
I tried to get the exporter up & running but on datasource creation (save & test) in prometheus i get an exception:
I'm using the "lekpamartin/uptimerobot_exporter:latest" image.
The POST request seems fine, so i thought my config is right.
Hey lekpamartin,
I have problem when I have more monitored pages, when i have one domain in uptimerobot it works fine:
127.0.0.1 - - [23/Jan/2020 21:19:35] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:19:49] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:20:04] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:20:19] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:20:34] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:20:49] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:21:05] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:21:19] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:21:34] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:21:49] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:22:04] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:22:19] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:22:34] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:22:49] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:23:04] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:23:19] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:23:34] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:23:49] "GET /metrics HTTP/1.1" 200 -
127.0.0.1 - - [23/Jan/2020 21:24:04] "GET /metrics HTTP/1.1" 200 -
but when it adds more monitors the python script crashes:
Exception happened during processing of request from ('127.0.0.1', 57420)
Traceback (most recent call last):
File "/usr/lib64/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib64/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib64/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib64/python2.7/SocketServer.py", line 649, in __init__
self.handle()
File "/usr/lib64/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib64/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/usr/bin/uptimerobot_exporter", line 121, in do_GET
format_prometheus(answer.get('monitors')).encode('utf-8')
File "/usr/bin/uptimerobot_exporter", line 59, in format_prometheus
item.get('response_times').pop().get('value'),
IndexError: pop from empty list
Trying to run this on a raspberry Pi 4 and I get this error when checking my docker logs. Has anyone got this running on an ARM based CPU?
pi@raspberrypi:~ $ sudo docker logs bfec5389915c
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
standard_init_linux.go:211: exec user process caused "exec format error"
Attaching to uptimerobot_exporter
uptimerobot_exporter | 192.168.2.2 - - [23/Sep/2021 12:58:00] "GET / HTTP/1.1" 200 -
uptimerobot_exporter | 192.168.2.2 - - [23/Sep/2021 12:58:02] "GET /favicon.ico HTTP/1.1" 200 -
uptimerobot_exporter | ----------------------------------------
uptimerobot_exporter | Exception occurred during processing of request from ('192.168.2.2', 65068)
uptimerobot_exporter | Traceback (most recent call last):
uptimerobot_exporter | File "/usr/local/lib/python3.9/socketserver.py", line 316, in _handle_request_noblock
uptimerobot_exporter | self.process_request(request, client_address)
uptimerobot_exporter | File "/usr/local/lib/python3.9/socketserver.py", line 347, in process_request
uptimerobot_exporter | self.finish_request(request, client_address)
uptimerobot_exporter | File "/usr/local/lib/python3.9/socketserver.py", line 360, in finish_request
uptimerobot_exporter | self.RequestHandlerClass(request, client_address, self)
uptimerobot_exporter | File "/usr/local/lib/python3.9/socketserver.py", line 747, in __init__
uptimerobot_exporter | self.handle()
uptimerobot_exporter | File "/usr/local/lib/python3.9/http/server.py", line 427, in handle
uptimerobot_exporter | self.handle_one_request()
uptimerobot_exporter | File "/usr/local/lib/python3.9/http/server.py", line 415, in handle_one_request
uptimerobot_exporter | method()
uptimerobot_exporter | File "/exporter.py", line 127, in do_GET
uptimerobot_exporter | accountdetails = fetch_accountdetails(api_key)
uptimerobot_exporter | File "/exporter.py", line 87, in fetch_accountdetails
uptimerobot_exporter | return req.json()
uptimerobot_exporter | File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 910, in json
uptimerobot_exporter | return complexjson.loads(self.text, **kwargs)
uptimerobot_exporter | File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
uptimerobot_exporter | return _default_decoder.decode(s)
uptimerobot_exporter | File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
uptimerobot_exporter | obj, end = self.raw_decode(s, idx=_w(s, 0).end())
uptimerobot_exporter | File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
uptimerobot_exporter | raise JSONDecodeError("Expecting value", s, err.value) from None
uptimerobot_exporter | json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
uptimerobot_exporter | ----------------------------------------
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.