Skip to content

Commit

Permalink
refactor: service details access in prometheus (#123)
Browse files Browse the repository at this point in the history
* refactor: service details refactored for dive

* refactor: removed print statement

* merge: resolved merge conflict

* refactor: service details access in prometheus
  • Loading branch information
Riya Singh authored Nov 27, 2023
1 parent 3344073 commit 0b262a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
16 changes: 10 additions & 6 deletions local.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
{
"chain-type": "local",
"relaychain": {
"name": "kusama",
"name": "rococo",
"nodes": [
{
"name": "alice",
"node-type": "validator",
"port": 9944
"port": 9944,
"prometheus": false
},
{
"name": "bob",
"node-type": "full",
"port": 9945
"port": 9945,
"prometheus": true
}
]
},
Expand All @@ -21,13 +23,15 @@
"nodes": [
{
"name": "alice",
"node-type": "collator"
"node-type": "collator",
"prometheus": true
},
{
"name": "bob",
"node-type": "full"
"node-type": "full",
"prometheus": false
}
]
}
}
}
}
8 changes: 4 additions & 4 deletions package_io/promethues.star
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ def new_config_template_data(plan, args, service_details):
relay_nodes = args["relaychain"]["nodes"]
for node in relay_nodes:
if node["prometheus"] == True:
endpoint = "{0}:{1}".format(service_details["relaychains"]["relay_service_{}".format(node["name"])].ip_address, service_details["relaychains"]["relay_service_{}".format(node["name"])].ports["prometheus"].number)
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 = "relay_service_{}".format(node["name"]),
job_name = service_details["relaychains"][0]["service_name"],
endpoint = endpoint,
scrape_interval = "5s",
),
Expand All @@ -89,11 +89,11 @@ def new_config_template_data(plan, args, service_details):
for parachain in args["para"]:
for node in args["para"][parachain]["nodes"]:
if node["prometheus"] == True:
endpoint = "{0}:{1}".format(service_details["parachains"][parachain.lower()]["parachain_{}".format(node["name"])].ip_address, service_details["parachains"][parachain.lower()]["parachain_{}".format(node["name"])].ports["prometheus"].number)
endpoint = "{0}:{1}".format(service_details["parachains"][0]["nodes"][0]["node_details"].ip_address, service_details["parachains"][0]["nodes"][0]["node_details"].ports["prometheus"].number)

metrics_jobs.append(
new_metrics_job(
job_name = "parachain_{}_{}".format(parachain, node["name"]),
job_name = service_details["parachains"][0]["parachain_name"],
endpoint = endpoint,
scrape_interval = "5s",
),
Expand Down
2 changes: 1 addition & 1 deletion parachain/static_files/images.star
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ parachain_images = {
"base": ["altair-local", "catalyst", "centrifuge"],
},
"bajun": {
"image": "ajuna/parachain-bajun:0.1.28",
"image": "ajuna/parachain-bajun:latest",
"entrypoint": "/usr/local/bin/ajuna",
"base": ["local", "/bajun/rococo/bajun-raw.json", "/bajun/bajun-raw.json"],
},
Expand Down

0 comments on commit 0b262a6

Please sign in to comment.