lib/splash/webadmin/portal/controllers/proxy.rb in prometheus-splash-0.6.0 vs lib/splash/webadmin/portal/controllers/proxy.rb in prometheus-splash-0.6.1
- old
+ new
@@ -1,11 +1,9 @@
WebAdminApp.use Rack::ReverseProxy do
- config = get_config
- url = "http://#{config.prometheus_pushgateway_host}:#{config.prometheus_pushgateway_port}/#{config.prometheus_pushgateway_path}"
- reverse_proxy /^\/pushgateway\/?(.*)$/, url
+ reverse_proxy /^\/pushgateway\/?(.*)$/, get_config.prometheus_pushgateway_url
reverse_proxy_options preserve_host: true
end
WebAdminApp.use Rack::ReverseProxy do
@@ -21,10 +19,10 @@
@proxy = true
@pushgateway_url = "http://#{config.webadmin_ip}:#{config.webadmin_port}/pushgateway"
@prometheus_url = "http://#{config.webadmin_ip}:#{config.webadmin_port}/prometheus"
else
@proxy = false
- @pushgateway_url = "http://#{config.prometheus_pushgateway_host}:#{config.prometheus_pushgateway_port}/#{config.prometheus_pushgateway_path}"
- @prometheus_url = "http://#{config.prometheus_url}"
+ @pushgateway_url = "#{config.prometheus_pushgateway_url}"
+ @prometheus_url = "#{config.prometheus_url}"
end
slim :proxy, :format => :html
end