This plugin logs API traffic to Moesif API Analytics, which enables you to:
- Understand customer API usage
- Debug issues quickly
- Monetize your APIs
- Get alerted of API issues
- Guide customers at scale
- Protect and govern your API
This plugin supports automatic analysis of high-volume REST, GraphQL, and other APIs without adding latency.
How it works
When enabled, this plugin captures API traffic and logs it to Moesif API Analytics. This plugin logs to Moesif with an asynchronous design and doesn’t add any latency to your API calls.
Moesif natively supports REST, GraphQL, Web3, SOAP, JSON-RPC, and more.
How to install
If you are using Kong’s Kubernetes Ingress Controller, the installation is slightly different. Review the docs for Kubernetes Ingress.
The .rock
file is a self-contained package that can be installed locally or from a remote server.
If the LuaRocks utility is installed in your system (this is likely the case if you used one of the official installation packages), you can install the ‘rock’ in your LuaRocks tree (a directory in which LuaRocks installs Lua modules).
Install the Moesif plugin
luarocks install --server=http://luarocks.org/manifests/moesif kong-plugin-moesif
Update your loaded plugins list
In your kong.conf
, append moesif
to the plugins
field (or custom_plugins
if old version of Kong). Make sure the field is not commented out.
plugins = bundled,moesif # Comma-separated list of plugins this node
# should load. By default, only plugins
# bundled in official distributions are
# loaded via the `bundled` keyword.
If you don’t have a kong.conf
, create one from the default using the following command:
cp /etc/kong/kong.conf.default /etc/kong/kong.conf
Restart Kong
After LuaRocks is installed, restart Kong before enabling the plugin
kong restart
Enable the Moesif plugin
curl -i -X POST --url http://localhost:8001/plugins/ --data "name=moesif" --data "config.application_id=YOUR_APPLICATION_ID";
Restart Kong again
If you don’t see any logs in Moesif, you may need to restart Kong again.
kong restart