diff options
-rw-r--r-- | ansible/playbook-test.yml | 2 | ||||
-rw-r--r-- | build/test/gondul-grafana-test.Dockerfile | 2 | ||||
-rw-r--r-- | extras/misc/varnish.vcl | 14 |
3 files changed, 14 insertions, 4 deletions
diff --git a/ansible/playbook-test.yml b/ansible/playbook-test.yml index d9973c7..c125160 100644 --- a/ansible/playbook-test.yml +++ b/ansible/playbook-test.yml @@ -28,7 +28,7 @@ ports: [] - name: "gondul-varnish-test" volumes: [ "{{ pwd.stdout }}/:/opt/gondul" ] - links: [ "gondul-front-test:gondul-front", "gondul-graphite-test:gondul-graphite", "gondul-templating-test:gondul-templating" ] + links: [ "gondul-front-test:gondul-front", "gondul-graphite-test:gondul-graphite", "gondul-templating-test:gondul-templating", "gondul-grafana-test:gondul-grafana" ] ports: "{{ varnish_ports }}" - name: "gondul-collector-test" volumes: [ "{{ pwd.stdout }}/:/opt/gondul" ] diff --git a/build/test/gondul-grafana-test.Dockerfile b/build/test/gondul-grafana-test.Dockerfile index ef560e7..00345b6 100644 --- a/build/test/gondul-grafana-test.Dockerfile +++ b/build/test/gondul-grafana-test.Dockerfile @@ -1,2 +1,2 @@ FROM grafana/grafana:4.0.0-beta1 - +ENV GF_SERVER_ROOT_URL http://nms-dev.gathering.org/grafana/ diff --git a/extras/misc/varnish.vcl b/extras/misc/varnish.vcl index dd71a31..4920963 100644 --- a/extras/misc/varnish.vcl +++ b/extras/misc/varnish.vcl @@ -17,6 +17,11 @@ backend templating { .port = "8080"; } +backend grafana { + .host = "gondul-grafana"; + .port = "3000"; +} + sub vcl_recv { if (req.url ~ "^/where" || req.url ~ "^/location") { set req.url = "/api/public/location"; @@ -32,10 +37,15 @@ sub vcl_recv { return (synth(418,"LOLOLOL")); } - if (req.url ~ "/render") { + if (req.url ~ "^/render") { set req.backend_hint = graphite; } - if (req.url ~ "/api/templates") { + if (req.url ~ "^/grafana") { + set req.url = regsub(req.url, "^/grafana",""); + set req.backend_hint = grafana; + return (pass); + } + if (req.url ~ "^/api/templates") { set req.url = regsub(req.url, "/api/templates", ""); set req.backend_hint = templating; } |