Using Pump with CE Gateway to export to Prometheus

Hi there, I’m trying to use Pump with the CE Gateway to export gateway metrics to Prometheus. Everything is running in docker and I’m using images for the gateway & pump from dockerhub.

I’ve set “enable_analytics”: true in my tyk.conf, and have a pump.conf as follows:
{
“analytics_storage_type”: “redis”,
“analytics_storage_config”: {
“type”: “redis”,
“host”: “redis”,
“port”: 6379,
“hosts”: null,
“username”: “”,
“password”: “”,
“database”: 0,
“optimisation_max_idle”: 2000,
“optimisation_max_active”: 4000,
“enable_cluster”: false
},
“purge_delay”: 1,
“pumps”: {
“csv”: {
“type”: “csv”,
“meta”: {
“csv_dir”: “./”
}
},
“prometheus”: {
“type”: “prometheus”,
“meta”: {
“listen_address”: “:9090”,
“path”: “/metrics”
}
},
},
“dont_purge_uptime_data”: false
}

For now I’m volume mounting this as /opt/tyk-pump/pump.conf

the redis settings match whats in the tyk.conf.

I can see the /metrics endpoint exposed by the pump, but I don’t see any of the counters / histograms that the pump repo says I should expect to see… i.e.

  • tyk_http_status{code, api}
  • tyk_http_status_per_path{code, api, path, method}
  • tyk_http_status_per_key{code, key}
  • tyk_http_status_per_oauth_client{code, client_id}
  • tyk_latency{type, api}

Any suggestions on what I need to do to get them to appear?

Thanks in advance,

James

Further to my question, I got this working by configuring “dont_purge_uptime_data”: true

However, the tyk_http_status_per_key{code, key} counters are all reporting 0 for all keys, including those which are being actively used - any ideas why this is so? Missing config for the gateway or pump?

Thanks,

James