diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-03-05 21:34:59 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2018-03-05 21:34:59 +0300 |
commit | 5ceec83a0154e513480a9bb08e252371bf7886c6 (patch) | |
tree | 9a193e295c56feb2c29ac042b59b14b1808715d1 /app/controllers/projects/prometheus | |
parent | 273e4142566a053e0628183fbf86ef7b94cb5a66 (diff) |
Implemente Prometheus:AdapterService
Diffstat (limited to 'app/controllers/projects/prometheus')
-rw-r--r-- | app/controllers/projects/prometheus/metrics_controller.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/projects/prometheus/metrics_controller.rb b/app/controllers/projects/prometheus/metrics_controller.rb index ec3c49059e1..523abce35fb 100644 --- a/app/controllers/projects/prometheus/metrics_controller.rb +++ b/app/controllers/projects/prometheus/metrics_controller.rb @@ -1,8 +1,6 @@ module Projects module Prometheus class MetricsController < Projects::ApplicationController - include PrometheusAdapterLocator - before_action :authorize_admin_project! before_action :require_prometheus_metrics! @@ -22,6 +20,10 @@ module Projects private + def prometheus_adapter + @prometheus_adapter ||= Prometheus::AdapterService.new(project).prometheus_adapter + end + def require_prometheus_metrics! render_404 unless prometheus_adapter.can_query? end |