diff --git a/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraph.tsx b/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraph.tsx index 092ffeab2a9..5fc11b97a15 100644 --- a/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraph.tsx +++ b/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraph.tsx @@ -269,6 +269,7 @@ const FlameGraph = ({ setSelectedBarIndex={setSelectedBarIndex} setRangeMin={setRangeMin} setRangeMax={setRangeMax} + getLabelValue={getLabelValue} /> )} diff --git a/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraphContextMenu.tsx b/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraphContextMenu.tsx index e3ecddcebda..c61a5f3fb28 100644 --- a/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraphContextMenu.tsx +++ b/public/app/plugins/panel/flamegraph/components/FlameGraph/FlameGraphContextMenu.tsx @@ -16,6 +16,7 @@ type Props = { setSelectedBarIndex: (bar: number) => void; setRangeMin: (range: number) => void; setRangeMax: (range: number) => void; + getLabelValue: (label: string | number) => string; }; const FlameGraphContextMenu = ({ @@ -28,6 +29,7 @@ const FlameGraphContextMenu = ({ setSelectedBarIndex, setRangeMin, setRangeMax, + getLabelValue, }: Props) => { const renderMenuItems = () => { return ( @@ -55,7 +57,7 @@ const FlameGraphContextMenu = ({ onClick={() => { if (graphRef.current && contextMenuData) { const bar = levels[contextMenuData.levelIndex][contextMenuData.barIndex]; - navigator.clipboard.writeText(bar.label).then(() => { + navigator.clipboard.writeText(getLabelValue(bar.label)).then(() => { setContextMenuData(undefined); }); }