3scale Support's Top 5 All-Time Troubleshooting Favorites
We get to see and work with a lot of great APIs and setups; getting things up and running at the beginning isn’t always plain sailing, but luckily, we have an arsenal of great tools and services that we use to make both our lives and those of our customers much easier.
Join the DZone community and get the full member experience.Join For Free
Working at 3scale support means that we get to see and work with a lot of great APIs and setups. However, getting things up and running at the beginning isn’t always plain sailing and it’s not uncommon to hit some snags along the way. Luckily, we have an arsenal of great tools and services that we use to make both our lives and those of our customers much easier. So here we go – in true countdown style, we’ll start at number 5:
At number 5, we have a Lua library written by 3scale alumnus kikito. Inspect allows you to transform any Lua object into a human-readable format. It is especially useful when debugging the state of various variables in Lua, such as when inspecting the request parameters sent to the API gateway. If you are doing more esoteric Lua programming, you can also use it in conjunction with the getmetatable() built-in Lua function to see the fields and operations available on a Lua object.
RequestBin is an old favorite among the 3scale support team. It’s provided by the excellent folks at Runscope. RequestBin gives you an endpoint that you can use to send HTTP requests to for later inspection. The cool thing about it is that all the data contained in the request (headers, body, etc.) are displayed in an easy-to-read format. You can also create both public and private endpoints.
At 3scale, we use it all the time when we’re unsure of the exact request that is being sent (and received by the remote endpoint). It is especially useful for troubleshooting requests between a client and API gateway as well as between the API gateway and 3scale.
In third position, we have a slightly different beast. Kibana is something that we use internally at 3scale for our own troubleshooting of the 3scale API backend and requests made from the API gateways deployed by our customers.
Whereas the other tools featured are ready to use, this is something that needs careful setup and configuration to make it work for your own infrastructure and needs. In our case, we have set it up to parse our server logs and provide an interface to easily search for HTTP requests to our different systems.
Of course, a lot of it depends on how you set it up and use it to parse your logs, but we find it invaluable when troubleshooting tricky customer issues, especially for requests that should work but somehow don’t. Our setup allows us to see the exact request made to our backend, as well as allowing us to track it through all of the different infrastructure layers it has gone through.
The first position was heavily contested. Narrowly losing out on the top spot, at number 2, my personal all-time favorite: ngrok.
A lot of the time we need to troubleshoot a customer’s API gateway configuration. The best way to do this is to try to closely replicate their setup. This involves running our own API gateway instance somewhere. While we could just spin up a pre-prepared AWS instance and drop in the configs, this can be a bit cumbersome, especially if you need to make lots of edits on the fly to make the configs work.
So, what is ngrok? Well, it’s simply a way to expose your chosen localhost port to the public internet. Once you have your local gateway up and listening on some port (e.g. 80), you can just run ./ngrok http 80 and you will get your own ngrok subdomain to start sending requests to.
This way, you have access to all your favorite offline editors for tweaking the configs – speeding up your edit, deploy, and test cycle.
Finally, the number one position could only go to…
At 3scale support, we have to run a lot of API requests. Sure, we go old school and do a quick cURL most of the time. But if we know we’re going to have to run something again in the future, nothing beats Postman for repeatability. You can save the request, tweak the parameters, add variables, et voila! You have a quick way of checking responses in a human-friendly way, and if you need to share it with your colleagues, you can just export to JSON and they’re ready to go also.
Another great feature that we love is the Runner. Although this is mainly intended for running tests on, we use it for quick running of the same set of queries on a number of objects, for example to import accounts and credentials into 3scale from a CSV file. You can just set up variables in your Postman request to match the CSV column headers, and you’re done! No more writing custom scripts for different CSV file layouts.
For black-belt users, there is also the option of chaining requests and acting based on prior responses, but give us some time… we’re not quite there yet ;)
There is almost nothing you can’t do with Postman. It even does the dreaded AWS Signature Version 4 Authorization for you! And if you’re on Mac, they’ve even got a dedicated OS X app now.
There are many other features that we are still discovering and we’re sure some of you have some creative uses for Postman as well. Feel free to let us know in the comments!
So, that’s our top 5 for you. Other cool products that didn’t make it this time:
- Google OAuth playground: Easily test your OAuth flows.
- OpenSSL: A swiss army knife of commands for anything and everything to do with SSL.
- Tcpdump: Capture all request data into one file for later troubleshooting.
We’re always on the lookout for great new tools to make our lives easier. What are some of yours? (P.S. We’re hiring!)
Published at DZone with permission of Steven Willmott, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.