Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uptimerobot_exporter crashes when in uptimerobots i have more than one monitor #2

Open
rafalmasiarek opened this issue Jan 23, 2020 · 7 comments

Comments

@rafalmasiarek
Copy link

rafalmasiarek commented Jan 23, 2020

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
@lekpamartin
Copy link
Owner

Hi,

How many monitors do you have ?

Martin

@interbiznw
Copy link

interbiznw commented Mar 7, 2020

I have 7 when I first installed and it seems to work fine, I added 2 more via UptimeRobot Website and it crashed the exporter

----------------------------------------
172.17.0.1 - - [07/Mar/2020 13:54:21] "GET /metrics HTTP/1.1" 200 -
----------------------------------------
Exception happened during processing of request from ('172.17.0.1', 35544)
Traceback (most recent call last):
File "/usr/local/lib/python3.8/socketserver.py", line 316, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/lib/python3.8/socketserver.py", line 347, in process_request
self.finish_request(request, client_address)
File "/usr/local/lib/python3.8/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/lib/python3.8/socketserver.py", line 720, in __init__
self.handle()
File "/usr/local/lib/python3.8/http/server.py", line 426, in handle
self.handle_one_request()
File "/usr/local/lib/python3.8/http/server.py", line 414, in handle_one_request
method()
File "/exporter.py", line 119, in do_GET
format_prometheus(answer.get('monitors')).encode('utf-8')
File "/exporter.py", line 57, in format_prometheus
item.get('response_times').pop().get('value'),
IndexError: pop from empty list
----------------------------------------

I take the 2 monitors off that I added, and it works again.

is there some sort of limit?

@lekpamartin
Copy link
Owner

Hi,
It seem like a bug in the API.
Disable (pause) one monitor and enable (start) it again?

@morlandi
Copy link

Last week I got the same error.
Now the very same code is working fine.
Maybe the UptimeRobots API has been updated/fixed ?

@lekpamartin
Copy link
Owner

Hi,
In my case the bug is still there. When I had some monitors the API output doesnt display response time.
If I disable one monitor and enable it again the API display response time.

@funnelcloudservices
Copy link

I'm having the same issue. Works fine at 6 monitors. At 7 it stops. I need 30 or so at some point. 😁

@funnelcloudservices
Copy link

Update, after letting it sit there I am now getting data. I'm not sure if it's due to a Prometheus restart or if it's having other issues. I'll have to let it run for a while to see if it's reliable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants