Skip to content

Commit

Permalink
fix: issue in prometheus while relaychain are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
shanithkk committed Nov 28, 2023
1 parent 1fe73b1 commit 69cdc00
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package_io/constant.star
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DIFFERENT_IMAGES_FOR_TESTNET = {
"centrifuge": "centrifugeio/centrifuge-chain:main-latest",
"karura": "acala/mandala-node:latest",
"clover": "cloverio/clover-iris:0.1.15",
"subsocial": "dappforce/subsocial-parachain:rococo"
"subsocial": "dappforce/subsocial-parachain:latest"
}

CHAIN_COMMAND = ["manta", "moonsama", "interlay", "kintsugi-btc"]
25 changes: 13 additions & 12 deletions package_io/promethues.star
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,20 @@ def get_config(config_files_artifact_name):
def new_config_template_data(plan, args, service_details):
metrics_jobs = []

relay_nodes = args["relaychain"]["nodes"]
for node in relay_nodes:
if node["prometheus"] == True:
endpoint = "{0}:{1}".format(service_details["relaychains"][0]["service_details"].ip_address, service_details["relaychains"][0]["service_details"].ports["prometheus"].number)
if len(args["relaychain"]) != 0:
relay_nodes = args["relaychain"]["nodes"]
for node in relay_nodes:
if node["prometheus"] == True:
endpoint = "{0}:{1}".format(service_details["relaychains"][0]["service_details"].ip_address, service_details["relaychains"][0]["service_details"].ports["prometheus"].number)

metrics_jobs.append(
new_metrics_job(
job_name = service_details["relaychains"][0]["service_name"],
endpoint = endpoint,
scrape_interval = "5s",
),
)
plan.print(node["prometheus"])
metrics_jobs.append(
new_metrics_job(
job_name = service_details["relaychains"][0]["service_name"],
endpoint = endpoint,
scrape_interval = "5s",
),
)
plan.print(node["prometheus"])

for parachain in args["para"]:
for node in args["para"][parachain]["nodes"]:
Expand Down

0 comments on commit 69cdc00

Please sign in to comment.