mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[APM][OTel] Fix spanlink invalid filter (#215322)
## Summary Fixes https://github.com/elastic/kibana/issues/215101 This PR adds an optional check for `span.id` (this value is always populated) when redirecting to an error within a span link.
This commit is contained in:
parent
f8b3e93573
commit
8fc00a088f
2 changed files with 9 additions and 3 deletions
|
@ -33,6 +33,7 @@ export interface WaterfallTransaction {
|
|||
coldstart?: boolean;
|
||||
};
|
||||
span?: {
|
||||
id?: string;
|
||||
links?: SpanLink[];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ import type { ReactNode } from 'react';
|
|||
import React, { useRef, useEffect, useState } from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import { isMobileAgentName, isRumAgentName } from '../../../../../../../common/agent_name';
|
||||
import { TRACE_ID, TRANSACTION_ID } from '../../../../../../../common/es_fields/apm';
|
||||
import { SPAN_ID, TRACE_ID, TRANSACTION_ID } from '../../../../../../../common/es_fields/apm';
|
||||
import { asDuration } from '../../../../../../../common/utils/formatters';
|
||||
import type { Margins } from '../../../../../shared/charts/timeline';
|
||||
import { TruncateWithTooltip } from '../../../../../shared/truncate_with_tooltip';
|
||||
|
@ -333,8 +333,13 @@ function RelatedErrors({
|
|||
);
|
||||
|
||||
let kuery = `${TRACE_ID} : "${item.doc.trace.id}"`;
|
||||
if (item.doc.transaction?.id) {
|
||||
kuery += ` and ${TRANSACTION_ID} : "${item.doc.transaction?.id}"`;
|
||||
const transactionId = item.doc.transaction?.id;
|
||||
const spanId = item.doc.span?.id;
|
||||
|
||||
if (item.docType === 'transaction' && spanId) {
|
||||
kuery += ` and ${SPAN_ID} : "${spanId}"`;
|
||||
} else if (transactionId) {
|
||||
kuery += ` and ${TRANSACTION_ID} : "${transactionId}"`;
|
||||
}
|
||||
|
||||
const mobileHref = apmRouter.link(`/mobile-services/{serviceName}/errors-and-crashes`, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue