Skip to content

Commit

Permalink
fix: replace prometheus with metrics module
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Feb 21, 2025
1 parent 8a8aa39 commit e9ac01b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ add1_module_failures = agent.tasks.runp_brief([
'node': NODE_ID,
}},
{"agent_id": "cluster", "action": "add-module", "data": {
'image': 'ghcr.io/nethserver/prometheus:alertmanager', #FIXME
'image': 'ghcr.io/nethserver/metrics:latest', #FIXME
'node': NODE_ID,
}},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ update_module_errors = agent.tasks.runp_brief(update_module_tasks,
progress_callback=agent.get_progress_callback(75, 95),
)

# Check if prometheus is installed on the leader (this action is invoked on the leader, so NODE_ID is the leader)
is_prometheus_installed = False
# Check if metrics is installed on the leader (this action is invoked on the leader, so NODE_ID is the leader)
is_metrics_installed = False
installed = cluster.modules.list_installed(rdb, skip_core_modules=False)
for module in cluster.modules.list_installed(rdb, skip_core_modules=False):
for instance in installed[module]:
if not 'core_module' in instance.get('flags', []):
continue # skip module without core_module flag
if instance.get('module') == 'prometheus' and instance.get('node') == os.getenv("NODE_ID"):
is_prometheus_installed = True
if instance.get('module') == 'metrics' and instance.get('node') == os.getenv("NODE_ID"):
is_metrics_installed = True

# Install prometheus if not installed
if not is_prometheus_installed:
# Install metrics if not installed
if not is_metrics_installed:
add_module_failures = agent.tasks.runp_brief([
{"agent_id": "cluster", "action": "add-module", "data": {
'image': 'ghcr.io/nethserver/prometheus:alertmanager', #FIXME
'image': 'ghcr.io/nethserver/metrics:latest', #FIXME
'node': int(os.getenv("NODE_ID")),
}},
],
Expand Down

0 comments on commit e9ac01b

Please sign in to comment.