Skip to content

Commit

Permalink
use ProfilingLink instead of <a/> tags (ray-project#37840)
Browse files Browse the repository at this point in the history
In addition to removing unnecessary code duplication, these changes fix the links to the stack trace and flame graph pages when behind a reverse proxy. Previously the links used in NodeRow.tsx included a leading / that is not included in other links and does not work when hosting the Ray dashboard behind a reverse proxy.
  • Loading branch information
noahjax authored Aug 23, 2023
1 parent bde33fa commit 548f810
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions dashboard/client/src/pages/node/NodeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import useSWR from "swr";
import { CodeDialogButtonWithPreview } from "../../common/CodeDialogButton";
import { API_REFRESH_INTERVAL_MS } from "../../common/constants";
import { NodeLink } from "../../common/links";
import {
CpuProfilingLink,
CpuStackTraceLink,
} from "../../common/ProfilingLink";
import rowStyles from "../../common/RowStyles";
import PercentageBar from "../../components/PercentageBar";
import { StatusChip } from "../../components/StatusChip";
Expand Down Expand Up @@ -254,23 +258,8 @@ export const WorkerRow = ({ node, worker }: WorkerRowProps) => {
Logs
</Link>
<br />
<a
href={`/worker/traceback?pid=${pid}&ip=${ip}&native=0`}
target="_blank"
title="Sample the current Python stack trace for this worker."
rel="noreferrer"
>
Stack&nbsp;Trace
</a>
<br />
<a
href={`/worker/cpu_profile?pid=${pid}&ip=${ip}&duration=5&native=0`}
target="_blank"
title="Profile the Python worker for 5 seconds (default) and display a CPU flame graph."
rel="noreferrer"
>
CPU&nbsp;Flame&nbsp;Graph
</a>
<CpuStackTraceLink pid={pid} ip={ip} type="" />
<CpuProfilingLink pid={pid} ip={ip} type="" />
<br />
</TableCell>
<TableCell>
Expand Down

0 comments on commit 548f810

Please sign in to comment.