Skip to content

Commit

Permalink
DO-1855 fixing the datasources path (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
balda-rdx authored Sep 29, 2023
1 parent 15b7935 commit 86ac61c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions node-runner-cli/monitoring/monitoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ def setup_datasource(default_datasource_cfg_url, monitoring_config_dir):
req = requests.Request('GET', f'{default_datasource_cfg_url}')
prepared = req.prepare()
resp = Helpers.send_request(prepared, print_response=False)
Path(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources").mkdir(parents=True, exist_ok=True)
with open(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources/babylon-ledgersource.yml", 'wb') as f:
Path(f"{monitoring_config_dir}/grafana/provisioning/datasources").mkdir(parents=True, exist_ok=True)
with open(f"{monitoring_config_dir}/grafana/provisioning/datasources/babylon-ledgersource.yml", 'wb') as f:
f.write(resp.content)

@staticmethod
def template_datasource(monitoring_config_dir):
render_template = Renderer().load_file_based_template("datasource.yml.j2").render({}).to_yaml()
Path(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources").mkdir(parents=True, exist_ok=True)
file_location = f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources/babylon-ledgersource.yml"
Path(f"{monitoring_config_dir}/grafana/provisioning/datasources").mkdir(parents=True, exist_ok=True)
file_location = f"{monitoring_config_dir}/grafana/provisioning/datasources/datasource.yml"
Helpers.section_headline("Downloading datasource for grafana")
Helpers.dump_rendered_template(render_template, file_location)

Expand Down

0 comments on commit 86ac61c

Please sign in to comment.