Skip to content

Commit

Permalink
[v9.3.x] Prometheus: Add traceID field on top of the exemplar popover (
Browse files Browse the repository at this point in the history
…#60035)

Prometheus: Add traceID field on top of the exemplar popover (#59920)

Prioritize trace link

(cherry picked from commit 694dc60)

Co-authored-by: Ludovic Viaud <ludovic.viaud@gmail.com>
  • Loading branch information
grafanabot and LudoVio committed Dec 8, 2022
1 parent 8172672 commit 9f3a952
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export const ExemplarMarker: React.FC<ExemplarMarkerProps> = ({
}, [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,
Expand All @@ -94,7 +98,7 @@ export const ExemplarMarker: React.FC<ExemplarMarkerProps> = ({
<div>
<table className={styles.exemplarsTable}>
<tbody>
{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)
Expand Down

0 comments on commit 9f3a952

Please sign in to comment.