Skip to content

Commit

Permalink
Fix overview page to work with the new DASHBOARD_UID env var (ray-pro…
Browse files Browse the repository at this point in the history
…ject#32279)

In ray-project#32255 , i added a new env var to customize grafana dashboard uid. I forgot to use this var in the overview page.
I also made the "View in Grafana" button take the user directly to the dashboard instead of the homepage of Grafana.

Signed-off-by: Alan Guo aguo@anyscale.com
  • Loading branch information
alanwguo committed Feb 7, 2023
1 parent 1767201 commit c813a2a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dashboard/client/src/pages/metrics/Metrics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ export const Metrics = ({ newIA = false }: MetricsProps) => {
})}
>
<Button
href={grafanaHost}
href={`${grafanaHost}/d/${grafanaDefaultDashboardUid}`}
target="_blank"
rel="noopener noreferrer"
endIcon={<RiExternalLinkLine />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ export const ClusterUtilizationCard = ({
}: ClusterUtilizationCardProps) => {
const classes = useStyles();

const { grafanaHost, prometheusHealth, sessionName } =
useContext(GlobalContext);
const path =
"/d-solo/rayDefaultDashboard/default-dashboard?orgId=1&theme=light&panelId=41";
const {
grafanaHost,
prometheusHealth,
sessionName,
grafanaDefaultDashboardUid = "rayDefaultDashboard",
} = useContext(GlobalContext);
const path = `/d-solo/${grafanaDefaultDashboardUid}/default-dashboard?orgId=1&theme=light&panelId=41`;
const timeRangeParams = "&from=now-30m&to=now";

return (
Expand Down
11 changes: 7 additions & 4 deletions dashboard/client/src/pages/overview/cards/NodeCountCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,13 @@ type NodeCountCardProps = {
export const NodeCountCard = ({ className }: NodeCountCardProps) => {
const classes = useStyles();

const { grafanaHost, prometheusHealth, sessionName } =
useContext(GlobalContext);
const path =
"/d-solo/rayDefaultDashboard/default-dashboard?orgId=1&theme=light&panelId=24";
const {
grafanaHost,
prometheusHealth,
sessionName,
grafanaDefaultDashboardUid = "rayDefaultDashboard",
} = useContext(GlobalContext);
const path = `/d-solo/${grafanaDefaultDashboardUid}/default-dashboard?orgId=1&theme=light&panelId=24`;
const timeRangeParams = "&from=now-30m&to=now";

return (
Expand Down

0 comments on commit c813a2a

Please sign in to comment.