summaryrefslogtreecommitdiff
path: root/app/controllers/projects/prometheus/metrics_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/prometheus/metrics_controller.rb')
-rw-r--r--app/controllers/projects/prometheus/metrics_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/prometheus/metrics_controller.rb b/app/controllers/projects/prometheus/metrics_controller.rb
index c20c80ba334..396841e667d 100644
--- a/app/controllers/projects/prometheus/metrics_controller.rb
+++ b/app/controllers/projects/prometheus/metrics_controller.rb
@@ -3,6 +3,7 @@
module Projects
module Prometheus
class MetricsController < Projects::ApplicationController
+ before_action :check_feature_availability!
before_action :authorize_admin_project!
before_action :require_prometheus_metrics!
@@ -127,6 +128,10 @@ module Projects
def metrics_params
params.require(:prometheus_metric).permit(:title, :query, :y_label, :unit, :legend, :group)
end
+
+ def check_feature_availability!
+ render_404 if Feature.enabled?(:remove_monitor_metrics)
+ end
end
end
end