From 9f3a952fcef795302b5a5655bbd411c051973430 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 8 Dec 2022 16:14:35 +0000 Subject: [PATCH] [v9.3.x] Prometheus: Add traceID field on top of the exemplar popover (#60035) Prometheus: Add traceID field on top of the exemplar popover (#59920) Prioritize trace link (cherry picked from commit 694dc60724c44e469b3f0b0a98273eb3066fa29d) Co-authored-by: Ludovic Viaud --- .../app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx b/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx index 6d2e18a582b..8cb06f34c3e 100644 --- a/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx +++ b/public/app/plugins/panel/timeseries/plugins/ExemplarMarker.tsx @@ -70,6 +70,10 @@ export const ExemplarMarker: React.FC = ({ }, [setIsOpen]); const renderMarker = useCallback(() => { + // Put the traceID field in front. + const traceIDField = dataFrame.fields.find((field) => field.name === 'traceID') || dataFrame.fields[0]; + const orderedDataFrameFields = [traceIDField, ...dataFrame.fields.filter((field) => traceIDField !== field)]; + const timeFormatter = (value: number) => { return dateTimeFormat(value, { format: systemDateFormats.fullDate, @@ -94,7 +98,7 @@ export const ExemplarMarker: React.FC = ({
- {dataFrame.fields.map((field, i) => { + {orderedDataFrameFields.map((field, i) => { const value = field.values.get(dataFrameFieldIndex.fieldIndex); const links = field.config.links?.length ? getFieldLinks(field, dataFrameFieldIndex.fieldIndex)