LogoLogo
  • User Guide
    • Getting Started
      • Building a Usage-Based Product in Revenium
      • Setting Up & Using API Analytics & Observability
      • Setting Up & Using Product Analytics
      • Sending Data to Revenium's Metering API
      • Key Concepts & Relationships
    • Connect Your Data
      • cURL Commands for Testing
      • Container-Native Metering
      • Kong
        • Kubernetes Installation
      • Salesforce
        • Revenium Unmanaged Package
          • Anypoint API Experience Hub (AEH)
            • Anypoint API Experience Hub Unmanaged Package Post Installation Instructions
          • Anypoint Community Manager (ACM)
            • Anypoint Community Manager Package Post Installation Instructions
        • Revenium Lightning Web Components
          • Add Components to Experience Cloud site
          • Drop-In Storefront
          • Product Card
          • Product Card (Anypoint)
          • Product Checkout
          • Product Details Button
          • Usage History
          • API Access Requester
      • MuleSoft
        • Metering Policy Configuration
        • Offline Metering Policy Configuration
        • Anypoint API & API Group Synchronization
        • Revenium Connector
        • Disable Default Anypoint Community Manager (ACM) Email Notifications
      • Gravitee
      • Istio
      • Envoy
      • AWS API Gateway
      • Python & Django
      • Golang
      • Spring Boot
      • .Net
      • NodeJs
      • Java/JVM
      • Snowflake
      • Azure API Management
      • IBM
      • Custom Integrations Using Metering Beacons
        • JWT Enrichment
      • Offline Metering via Log Parsing
    • Sources
      • Metering Elements
      • Alerts
        • Alert History
    • API Keys
    • Products & Pricing
      • Product Lines
      • Pricing Rules
        • Revenium Scripting Language
          • RSL Reference
        • Execution Logs
      • SLA Definitions
      • SLA Violation Review
    • Customers
      • Customers
      • Subscribers
      • Subscriptions
      • Subscribers Credentials
      • Subscribers Notifications
    • Billing and Invoicing
      • Manage Refunds
    • Analytics
      • Revenue Analytics
      • Product Analytics
        • Custom Reports (Products)
      • Subscriber Analytics
        • New Subscribers
        • (Daily/Weekly/Monthly) Active Subscribers
        • Most Engaged Subscribers & Customers
        • Historical Usage
      • API Analytics
        • Performance & Availability
        • Compare Periods
        • Traffic by Geography
        • Advanced Search
        • Custom Reports
    • Profile
      • Profile
      • Revenium API Documentation
    • Settings
      • Revenium Users & Organizations
        • Access Permissions by User Type
      • Revenium Subscription
      • Revenium Organizations
      • Notification Templates
      • Transactions Logs
        • Analytics Transaction Log
        • Product Transaction Log
        • Subscription Audit Log
        • No Code Transaction Testing
      • Integrations
        • Data Sync
        • Export Configurations
        • Notification Providers
        • Payment Configurations
          • Customer VAT ID Support
        • ERP Configurations
        • External Integration Logs
        • Identity Providers
      • System Logs
      • Default Configuration Limits
Powered by GitBook

© Revenium - www.revenium.io

On this page
  • Building and Installation
  • Enabling the Revenium Metering Plugin
  • Configuration
  1. User Guide
  2. Connect Your Data

Kong

The Kong Metering Plugin facilitates the capture of API transaction data flowing through Kong gateways for metering, monetization and chargeback.

Last updated 6 months ago

Building and Installation

To build and install this plugin please obtain the . Uncompress the package and run the following commands:

luarocks make
luarocks pack kong-plugin-revenium <RELEASE_VERSION>-1
luarocks install ./kong-plugin-revenium-<RELEASE_VERSION>-1.all.rock

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

source_id

yes

The Revenium ID of the source being metered (found under 'assets' or 'sources' in the Revenium application)

platform_url

no

The URL of the Revenium Platform API (almost always https://api.revenium.io)

platform_api_key

yes

The Revenium API integration key (found in your Revenium account)

subscription_credential_header

no

The header to identify the subscription (default is "clientId")

metadata_request_header

no

Optional HTTP request header to insert additional billing metadata

metadata_response_header

no

Optional HTTP response header to insert additional billing metadata

active_mode

no

If set to "true" API requests will be blocked by the plugin if the consumer is invalid, unfunded, etc.

subscription_cache_timeout

no

When using activeMode the length of time to cache valid consumers.

The Revenium Asset ID can be obtained from the Manage -> Sources pane in the Revenium UI

You can enable the Revenium Metering Plugin on a Kong Proxy by running a curl command similar to the one below:

curl -i -X POST \
--url http://kong-proxy:8001/services/example-service/plugins/ \
--data 'name=revenium-metering' \
--data 'config.platform_url=api.revenium.io' \
--data 'config.platform_api_key=hak_12348A7CC56B123472E' \
--data 'config.source_id=3a49abb3-93e5-495d-a49d-c6008e77c803' \
--data 'config.subscription_credential_header=clientId'

Alternatively the Revenium Metering Plugin can be configured via YAML configuration:

_format_version: "2.1"

_transform: true

services:
- name: random-data
  url: https://mockbin.org/bin/b6f8fc87-5dc0-4f9a-81df-0439282ee422/
  routes:
  - name: my-route
    paths:
    - /

plugins:
- name: revenium
  service: random-data
  config:
      source_id: ef191e46-e9d4-4553-a724-19529427b3c8
      platform_url: https://api.revenium.io
      platform_api_key: **Available in the Revenium UI**
Revenium Metering Plugin