USAGE METERING & INTELLIGENCE
Ingestion Options
API Gateway - Kong
3 min
you can use amberflo's api metering plugin for https //docs konghq com/gateway/latest/ to meter api requests handled by your kong instance monetize your apis based on usage for implementation details, see the https //github com/amberflo/kong plugin amberflo 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 https //docs konghq com/hub/kong inc/key auth/ , 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 https //github com/amberflo/kong plugin amberflo/blob/main/kong conf for more detailed guidance on configuring kong, refer to their official documentation https //docs konghq com/gateway/latest/plugin development/pluginserver/go/#example configuration and https //docs konghq com/gateway/latest/reference/configuration/ 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 https //github com/amberflo/kong plugin amberflo/blob/main/metering json here's a breakdown of the fields and their respective meanings
