Skip to content

Commit

Permalink
fix(grafana): use absolute file path (#176)
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf authored Feb 19, 2025
1 parent c1c3fc8 commit b62804e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,12 @@ optimism_package:
image: "prom/prometheus:latest"
# Default grafana configuration
grafana_params:
# A list of locators for grafana dashboards to be loaded be the grafana service
dashboard_sources: []
# A list of locators for grafana dashboards to be loaded by the grafana service.
# Each locator should be a URL to a directory containing a /folders and a /dashboards directory.
# Those will be uploaded to the grafana service by using grizzly.
# See https://github.com/ethereum-optimism/grafana-dashboards-public for more info.
dashboard_sources:
- github.com/ethereum-optimism/grafana-dashboards-public/resources
# Resource management for grafana container
# CPU is milicores
# RAM is in MB
Expand Down
5 changes: 4 additions & 1 deletion src/observability/grafana/grafana_launcher.star
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ def get_config(
)


# The dashboards pointed by the dashboard_sources locators are uploaded
# as file artifacts, then mounted into a container and pushed to the Grafana
# instance using https://grafana.github.io/grizzly/.
def provision_dashboards(plan, service_url, dashboard_sources):
if len(dashboard_sources) == 0:
return
Expand All @@ -130,7 +133,7 @@ def provision_dashboards(plan, service_url, dashboard_sources):
dashboard_name = "dashboards-{0}".format(index)
dashboard_artifact_name = plan.upload_files(dashboard_src, name=dashboard_name)

files[dashboard_name] = dashboard_artifact_name
files["/" + dashboard_name] = dashboard_artifact_name
grr_commands += grr_push_dashboards(dashboard_name)

plan.run_sh(
Expand Down
4 changes: 3 additions & 1 deletion src/package_io/input_parser.star
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ def default_prometheus_params():
def default_grafana_params():
return {
"image": "grafana/grafana:latest",
"dashboard_sources": [],
"dashboard_sources": [
"github.com/ethereum-optimism/grafana-dashboards-public/resources@ee47a8ec0545a06ef487ed5ec03ca692e258e5ec"
],
"min_cpu": 10,
"max_cpu": 1000,
"min_mem": 128,
Expand Down

0 comments on commit b62804e

Please sign in to comment.