Analytics Pump for the Tyk API Gateway

Introduction

Tyk is an open source API Gateway. Whether you are publishing an open API or need to manage your internal ones, Tyk can be used to control who accesses your API, when they access it, and how they access it

Important GitHub repos:

The Tyk Analytics Pump can be configured to move analytics data to any supported backend, including Moesif.

Setup

  1. Follow Tyk’s setup instructions to get a Tyk Gateway instance and Analytics Pump Instance running.

  2. Create a pump.conf to configure the Analytics Pump and add Moesif as a backend:

{
	"analytics_storage_type": "redis",
	"analytics_storage_config": {
		"type": "redis",
		"host": "localhost",
		"port": 6379,
		"hosts": null,
		"username": "",
		"password": "",
		"database": 0,
		"optimisation_max_idle": 100,
		"optimisation_max_active": 0,
		"enable_cluster": false
	},
	"purge_delay": 10,
	"pumps": {
		"dummy": {
			"name": "dummy",
			"meta": {}
		},
		"mongo": {
			"name": "mongo",
			"meta": {
				"collection_name": "tyk_analytics",
				"mongo_url": "mongodb://username:password@{hostname:port},{hostname:port}/{db_name}"
			}
		},
		"moesif": {
			"name": "moesif",
			"meta": {
				"application_id": ""
			}
		},
	},
	"uptime_pump_config": {
		"collection_name": "tyk_uptime_analytics",
		"mongo_url": "mongodb://username:password@{hostname:port},{hostname:port}/{db_name}"
	},
	"dont_purge_uptime_data": false
}

The only Moesif specific setting is application_id. You can find your Application Id from Moesif Dashboard -> Top Right Menu -> Extensions Setup -> Tyk API Gateway

Multiple Tyk api_id’s will be organized under the same Moesif application id.

Updated:

Leave a Comment