diff --git a/ui/packages/shared/profile/src/MetricsGraph/MetricsContextMenu/index.tsx b/ui/packages/shared/profile/src/MetricsGraph/MetricsContextMenu/index.tsx index e0361c89b4a..b511ddd313b 100644 --- a/ui/packages/shared/profile/src/MetricsGraph/MetricsContextMenu/index.tsx +++ b/ui/packages/shared/profile/src/MetricsGraph/MetricsContextMenu/index.tsx @@ -76,7 +76,12 @@ const MetricsContextMenu = ({ onAddLabelMatcher({key: label.name, value: label.value})} + onClick={() => { + onAddLabelMatcher({ + key: transformUtilizationLabels(label.name, utilizationMetrics), + value: label.value, + }); + }} className="max-w-[400px] overflow-hidden" >
diff --git a/ui/packages/shared/profile/src/MetricsGraph/UtilizationMetrics/index.tsx b/ui/packages/shared/profile/src/MetricsGraph/UtilizationMetrics/index.tsx index ac0ba77bc09..1d9b45d27ff 100644 --- a/ui/packages/shared/profile/src/MetricsGraph/UtilizationMetrics/index.tsx +++ b/ui/packages/shared/profile/src/MetricsGraph/UtilizationMetrics/index.tsx @@ -446,14 +446,15 @@ const RawUtilizationMetrics = ({ {series.map((s, i) => { let isSelected = false; - if ( - selectedSeriesMatchers != null && - selectedSeriesMatchers.length > 0 && - selectedSeriesMatchers.length === s.metric.length - ) { + if (selectedSeriesMatchers != null && selectedSeriesMatchers.length > 0) { isSelected = selectedSeriesMatchers.every(m => { for (let i = 0; i < s.metric.length; i++) { - if (s.metric[i].name === m.key && s.metric[i].value === m.value) { + if ( + s.metric[i].name + .replace('attributes_resource.', '') + .replace('attributes.', '') === m.key && + s.metric[i].value === m.value + ) { return true; } }