Christian Mague 1c372e3aa0 docs | 6 years ago | |
---|---|---|
puppet | 6 years ago | |
.gitignore | 6 years ago | |
.ruby-gemset | 6 years ago | |
.ruby-version | 6 years ago | |
Gemfile | 6 years ago | |
README.md | 6 years ago | |
Rakefile | 6 years ago | |
Vagrantfile | 6 years ago | |
dashboard.json | 6 years ago | |
setup_api.sh | 6 years ago |
sudo cp /etc/kong/kong.conf.default /etc/kong/kong.conf
add the following:
admin_listen = 0.0.0.0:8001
database = postgres
pg_host = 127.0.0.1
pg_port = 5432
pg_user = kong
pg_password = kong
pg_database = kong
Run Kong migrations and Kong
sudo kong migrations up
sudo kong start
Then on local box run
./setup_api.sh
cat <<EOF > /tmp/statsd_exporter-0.6.0.linux-amd64/statsd.rules
mappings:
#proxied requests
- match: kong.*.*.kong_latency
name: "kong_latency"
labels:
job: "kong"
api: "$2"
environment: "$1"
- match: kong.*.*.upstream_latency
name: "upstream_latency"
labels:
job: "kong"
api: "$2"
environment: "$1"
- match: kong.*.*.latency
name: "upstream_latency"
labels:
job: "kong"
api: "$2"
environment: "$1"
- match: kong.*.*.request.status.*
name: "status"
labels:
job: "kong"
api: "$2"
http: "$3"
environment: "$1"
- match: kong.*.*.*.size
name: "size"
labels:
job: "kong"
api: "$2"
phase: "$3"
environment: "$1"
EOF
Run the exporter
/tmp/statsd_exporter-0.6.0.linux-amd64$ ./statsd_exporter -statsd.mapping-config statsd.rules
Add the following lines to the end of /etc/prometheus/prometheus.yml and sudo systemctl restart prometheus
- job_name: 'statsd'
target_groups:
- targets: ['localhost:9102']
Restart Prometheus
sudo /etc/init.d/prometheus restart