Usage Metering
Ingestion Options

API Gateway - Kong

3min
you can use amberflo's api metering plugin for kong https //docs konghq com/gateway/ to meter the requests handled by your kong instance and monetize your apis see the repository https //github com/amberflo/kong plugin amberflo for more details ⚡ how it works this plugin will intercept the requests, detect which customer is making the request, generate a meter event and send it to amberflo customer detection happens via inspection of the request headers you can configure kong to inject the customer id as a header before this plugin runs for instance, if you use kong's key authentication https //docs konghq com/hub/kong inc/key auth/ plugin, this happens automatically to avoid impacting the performance of your gateway, the plugin will batch meter records and send them asynchronously to amberflo 🚀 installation compile and make the binary available to your kong instance make sure your compilation environment is compatible with your kong environment, otherwise the compile binary won't work update your kong configuration with the now available metering plugin for instance suppose you place the plugin server binary at /opt/amberflo/metering on the kong server then the plugin related parts of your kong conf file should look like this one for more details on how to configure kong, check out their docs here https //docs konghq com/gateway/latest/plugin development/pluginserver/go/#example configuration and here https //docs konghq com/gateway/latest/reference/configuration/ enable the plugin either by adding it to your kong yaml file or making an admin api request 📜 configuration please find a sample configuration file here https //github com/amberflo/kong plugin amberflo/blob/main/metering json here's a breakdown of the fields and their respective meanings