Re:Ask HN: Tools that can notify us when our REST API call f...
by black_blood on Monday May 29, 2017 @03:29AM
(#14437889)
I am using Node.js express. I am not worried about what the actual error is. I will figure out if the tool just tells me that the REST API call is failing.
Regarding POSTing a new user every 5 mins, I will not test such an API call. I will test a simple GET call which does not need any authentication.
So, I am looking for a simple tool that takes my GET API request, calls it every n minutes, and notifies me if the api request fails.
For timeouts, it may be tougher to do. If you use some kind of reverse proxy to spread the load to instances of your API, then this might be a nice place to start investigating your problems, and there is where you're going to want some tooling. If you're using Node.js, it could be possible the code for a specific endpoint does not send a response (maybe only under certain circumstances) - so you will need to debug that particular aspect of it and ensure that a response is sent, otherwise timeouts will happen.
As for actually sending test requests to your API, the difficultly with this method is that if, for example, you're posting a new user and your tool posts once every 5 mins, then you will have 12 garbage users after an hour. Not to mention that you will need to write a test for each error possibility as well, since it could be that a validation error is causing the timeout. So for this it probably makes sense to write a test suite, and include a test for each of the possible scenarios, or paths through your code.