No Description

Christian Mague 1c372e3aa0 docs 6 years ago
puppet 4d72ed0fe0 include dashboard 6 years ago
.gitignore d3fbaa4062 start upppet run 6 years ago
.ruby-gemset d3fbaa4062 start upppet run 6 years ago
.ruby-version d3fbaa4062 start upppet run 6 years ago
Gemfile fa0782abef fix puppet 6 years ago
README.md 1c372e3aa0 docs 6 years ago
Rakefile d3fbaa4062 start upppet run 6 years ago
Vagrantfile 88bd1b6600 working 6 years ago
dashboard.json 4d72ed0fe0 include dashboard 6 years ago
setup_api.sh 4d72ed0fe0 include dashboard 6 years ago

README.md

Setup Kong/Prometheus/Grafana Statsd

Run vagrant up

Configure Kong

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

Configure Statsd Exporter

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

Configure prometheus

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

Configure Grafana

  • Login to localhost:3000 admin/admin
  • Setup the prometheus data source ( Type: prometheus / URL http://localhost:9090/ / Access proxy )
  • import the example dashboard (dashboard.json)