summaryrefslogtreecommitdiff
path: root/app/workers/clusters
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-06-18 11:18:50 +0000
commit8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch)
treea77e7fe7a93de11213032ed4ab1f33a3db51b738 /app/workers/clusters
parent00b35af3db1abfe813a778f643dad221aad51fca (diff)
downloadgitlab-ce-8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781.tar.gz
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'app/workers/clusters')
-rw-r--r--app/workers/clusters/applications/activate_service_worker.rb2
-rw-r--r--app/workers/clusters/applications/check_prometheus_health_worker.rb30
-rw-r--r--app/workers/clusters/applications/deactivate_service_worker.rb2
-rw-r--r--app/workers/clusters/applications/uninstall_worker.rb1
-rw-r--r--app/workers/clusters/applications/wait_for_uninstall_app_worker.rb1
5 files changed, 36 insertions, 0 deletions
diff --git a/app/workers/clusters/applications/activate_service_worker.rb b/app/workers/clusters/applications/activate_service_worker.rb
index abd7f8eaea4..c92f978a7d2 100644
--- a/app/workers/clusters/applications/activate_service_worker.rb
+++ b/app/workers/clusters/applications/activate_service_worker.rb
@@ -6,6 +6,8 @@ module Clusters
include ApplicationWorker
include ClusterQueue
+ loggable_arguments 1
+
def perform(cluster_id, service_name)
cluster = Clusters::Cluster.find_by_id(cluster_id)
return unless cluster
diff --git a/app/workers/clusters/applications/check_prometheus_health_worker.rb b/app/workers/clusters/applications/check_prometheus_health_worker.rb
new file mode 100644
index 00000000000..2e8ee739946
--- /dev/null
+++ b/app/workers/clusters/applications/check_prometheus_health_worker.rb
@@ -0,0 +1,30 @@
+# frozen_string_literal: true
+
+module Clusters
+ module Applications
+ class CheckPrometheusHealthWorker
+ include ApplicationWorker
+ # rubocop:disable Scalability/CronWorkerContext
+ # This worker does not perform work scoped to a context
+ include CronjobQueue
+ # rubocop:enable Scalability/CronWorkerContext
+
+ queue_namespace :incident_management
+ feature_category :incident_management
+ urgency :low
+
+ idempotent!
+ worker_has_external_dependencies!
+
+ def perform
+ demo_project_ids = Gitlab::Monitor::DemoProjects.primary_keys
+
+ clusters = Clusters::Cluster.with_application_prometheus
+ .with_project_alert_service_data(demo_project_ids)
+
+ # Move to a seperate worker with scoped context if expanded to do work on customer projects
+ clusters.each { |cluster| Clusters::Applications::PrometheusHealthCheckService.new(cluster).execute }
+ end
+ end
+ end
+end
diff --git a/app/workers/clusters/applications/deactivate_service_worker.rb b/app/workers/clusters/applications/deactivate_service_worker.rb
index fecbb6dde45..4d103bb0edc 100644
--- a/app/workers/clusters/applications/deactivate_service_worker.rb
+++ b/app/workers/clusters/applications/deactivate_service_worker.rb
@@ -6,6 +6,8 @@ module Clusters
include ApplicationWorker
include ClusterQueue
+ loggable_arguments 1
+
def perform(cluster_id, service_name)
cluster = Clusters::Cluster.find_by_id(cluster_id)
raise cluster_missing_error(service_name) unless cluster
diff --git a/app/workers/clusters/applications/uninstall_worker.rb b/app/workers/clusters/applications/uninstall_worker.rb
index 977a25e8442..a9307931b59 100644
--- a/app/workers/clusters/applications/uninstall_worker.rb
+++ b/app/workers/clusters/applications/uninstall_worker.rb
@@ -8,6 +8,7 @@ module Clusters
include ClusterApplications
worker_has_external_dependencies!
+ loggable_arguments 0
def perform(app_name, app_id)
find_application(app_name, app_id) do |app|
diff --git a/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb b/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb
index a486cfa90b7..dc842788374 100644
--- a/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb
+++ b/app/workers/clusters/applications/wait_for_uninstall_app_worker.rb
@@ -12,6 +12,7 @@ module Clusters
worker_has_external_dependencies!
worker_resource_boundary :cpu
+ loggable_arguments 0
def perform(app_name, app_id)
find_application(app_name, app_id) do |app|