Commit 8d37589d authored by Valery Sizov's avatar Valery Sizov

Fix: Geo API bug. Statistic is not collected when prometheus is disabled

parent 2cb613d1
......@@ -24,6 +24,7 @@ module Geo
def fetch_geo_node_metrics(node)
return unless node.enabled?
return unless Gitlab::Geo.primary? || Gitlab::Metrics.prometheus_metrics_enabled?
status = node_status(node)
......@@ -33,7 +34,7 @@ module Geo
end
update_db_metrics(node, status) if Gitlab::Geo.primary?
update_prometheus_metrics(node, status)
update_prometheus_metrics(node, status) if Gitlab::Metrics.prometheus_metrics_enabled?
end
def update_db_metrics(node, status)
......
......@@ -7,8 +7,6 @@ module Geo
LEASE_TIMEOUT = 5.minutes
def perform
return unless Gitlab::Metrics.prometheus_metrics_enabled?
try_obtain_lease { Geo::MetricsUpdateService.new.execute }
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment