Usage Metering
Ingestion Options
API Gateway - Kong
3 min
you can use amberflo's api metering plugin for kong to meter api requests handled by your kong instance monetize your apis based on usage for implementation details, see the github repository how it works request interception the plugin intercepts incoming api requests handled by kong customer identification it determines which customer is making the request by inspecting request headers you can configure kong to inject the customerid header before this plugin runs example if you use kong's key authentication plugin , this is done automatically meter event generation the plugin generates a meter event for each request efficient metering to avoid performance overhead meter records are batched records are sent to amberflo asynchronously this setup ensures high throughput usage tracking with minimal impact on gateway performance installation compile the plugin binary compile the plugin and make the resulting binary available to your kong instance important ensure your compilation environment matches your kong runtime environment a mismatch may result in a binary that won't run correctly update kong configuration add the plugin to your kong configuration for example, if you place the plugin server binary at /opt/amberflo/metering then the relevant sections of your kong conf file should resemble this one for more detailed guidance on configuring kong, refer to their official documentation here and here enable the plugin you can enable the plugin in one of two ways add it to your kong yaml file or enable it via a call to the kong admin api configuration please find a sample configuration file here here's a breakdown of the fields and their respective meanings