Christian Mague 1c372e3aa0 docs | 6 anni fa | |
---|---|---|
puppet | 6 anni fa | |
.gitignore | 6 anni fa | |
.ruby-gemset | 6 anni fa | |
.ruby-version | 6 anni fa | |
Gemfile | 6 anni fa | |
README.md | 6 anni fa | |
Rakefile | 6 anni fa | |
Vagrantfile | 6 anni fa | |
dashboard.json | 6 anni fa | |
setup_api.sh | 6 anni fa |
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