diff --git a/python/ray/dashboard/modules/metrics/dashboards/common.py b/python/ray/dashboard/modules/metrics/dashboards/common.py index a841e904af33..aa7c54e8dd8d 100644 --- a/python/ray/dashboard/modules/metrics/dashboards/common.py +++ b/python/ray/dashboard/modules/metrics/dashboards/common.py @@ -114,6 +114,7 @@ class Target: "datasource": r"${datasource}", "description": "", "fieldConfig": {"defaults": {}, "overrides": []}, + # Setting height and width is important here to ensure the default panel has some size to it. "gridPos": {"h": 8, "w": 12, "x": 0, "y": 0}, "fill": 10, "fillGradient": 0, @@ -143,6 +144,31 @@ class Target: "pointradius": 2, "points": False, "renderer": "flot", + # These series overrides are necessary to make the "MAX" and "MAX + PENDING" dotted lines + # instead of stacked filled areas. + "seriesOverrides": [ + { + "$$hashKey": "object:2987", + "alias": "MAX", + "dashes": True, + "color": "#1F60C4", + "fill": 0, + "stack": False, + }, + { + "$$hashKey": "object:78", + "alias": "/FINISHED|FAILED|DEAD|REMOVED|Failed Nodes:/", + "hiddenSeries": True, + }, + { + "$$hashKey": "object:2987", + "alias": "MAX + PENDING", + "dashes": True, + "color": "#777777", + "fill": 0, + "stack": False, + }, + ], "spaceLength": 10, "stack": True, "steppedLine": False, diff --git a/python/ray/tests/test_metrics_head.py b/python/ray/tests/test_metrics_head.py index 6802f58d38db..6b31a000bead 100644 --- a/python/ray/tests/test_metrics_head.py +++ b/python/ray/tests/test_metrics_head.py @@ -147,6 +147,21 @@ def test_metrics_folder_with_dashboard_override( for panel in contents["panels"]: assert panel["gridPos"]["h"] > 0 assert panel["gridPos"]["w"] > 0 + # Check for series overrides for MAX and MAX + PENDING + found_max = False + found_max_pending = False + for panel in contents["panels"]: + for override in panel.get("seriesOverrides", []): + if override.get("alias") == "MAX": + assert override["fill"] == 0 + assert override["stack"] is False + found_max = True + if override.get("alias") == "MAX + PENDING": + assert override["fill"] == 0 + assert override["stack"] is False + found_max_pending = True + assert found_max + assert found_max_pending # Serve Dashboard with open(f"{override_dashboard_dir}/serve_grafana_dashboard.json") as f: