Skip to content

Commit

Permalink
feat: all_el_metrics (#195)
Browse files Browse the repository at this point in the history
Added el_client_contexts to launch_prometheus

---------

Co-authored-by: Gyanendra Mishra <anomaly.the@gmail.com>
  • Loading branch information
loocapro and h4ck3rk3y authored Sep 20, 2023
1 parent a63f2fd commit 3bbcca7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def run(plan, args = {}):
plan,
prometheus_config_template,
all_cl_client_contexts,
all_el_client_contexts,
)
plan.print("Successfully launched Prometheus")

Expand Down
13 changes: 9 additions & 4 deletions src/prometheus/prometheus_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@ USED_PORTS = {
HTTP_PORT_ID: shared_utils.new_port_spec(HTTP_PORT_NUMBER, shared_utils.TCP_PROTOCOL, shared_utils.HTTP_APPLICATION_PROTOCOL)
}

def launch_prometheus(plan, config_template, cl_client_contexts):
all_cl_nodes_metrics_info = []
def launch_prometheus(plan, config_template, cl_client_contexts, el_client_contexts):
all_nodes_metrics_info = []
for client in cl_client_contexts:
all_cl_nodes_metrics_info.extend(client.cl_nodes_metrics_info)
all_nodes_metrics_info.extend(client.cl_nodes_metrics_info)

template_data = new_config_template_data(all_cl_nodes_metrics_info)
for client in el_client_contexts:
# etheruemjs doesn't populate metrics just yet
if client.el_metrics_info != [None]:
all_nodes_metrics_info.extend(client.el_metrics_info)

template_data = new_config_template_data(all_nodes_metrics_info)
template_and_data = shared_utils.new_template_and_data(config_template, template_data)
template_and_data_by_rel_dest_filepath = {}
template_and_data_by_rel_dest_filepath[CONFIG_FILENAME] = template_and_data
Expand Down

0 comments on commit 3bbcca7

Please sign in to comment.