Kong
The Kong Metering Plugin facilitates the capture of API transaction data flowing through Kong gateways for metering, monetization and chargeback.
Building and Installation
To build and install this plugin please obtain the Revenium Metering Plugin package from your Revenium Account Team. Uncompress the package and run the following commands:
RELEASE_VERSION corresponds to the version of the Kong Metering Plugin Package (ie, 1.10.1)
Enabling the Revenium Metering Plugin
Configuration
The Revenium Kong Plugin accepts the following configuration parameters
Parameter | Required | Description |
---|---|---|
assetId | yes | The Revenium metering ID of the API being metered (found under 'assets' or 'sources' in the Revenium application) |
platformUrl | no | The URL of the Revenium Platform API (almost always https://api.revenium.io) |
platformApiKey | yes | The Revenium API integration key (found in your Revenium account) |
applicationHeader | no | The header to identify the consuming application (default is "clientId") |
metadataRequestHeader | no | Optional HTTP request header to insert additional billing metadata |
metadataResponseHeader | no | Optional HTTP response header to insert additional billing metadata |
activeMode | no | If set to "true" API requests will be blocked by the plugin if the consumer is invalid, unfunded, etc. |
productKeyCacheTimeout | no | When using activeMode the length of time to cache valid consumers. |
The Revenium Asset ID can be obtained from the Manage -> Assets pane in the Revenium UI
![](https://docs.revenium.io/~gitbook/image?url=https%3A%2F%2F2470865788-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FSUfCzMW8qWeXstipFXEh%252Fuploads%252FNuKXyFsLHjJH5k8vrhgZ%252FFigure%2520Asset%2520ID.png%3Falt%3Dmedia%26token%3Db27192a7-7eed-45c6-b641-f8477e403d3d&width=768&dpr=4&quality=100&sign=8949616b&sv=1)
You can enable the Revenium Metering Plugin on a Kong Proxy by running a curl command similar to the one below:
Alternatively the Revenium Metering Plugin can be configured via YAML configuration:
Last updated