Skip to content

Commit

Permalink
[APM] added check for 'error' waterfall item when view mobile transac…
Browse files Browse the repository at this point in the history
…tions (#174655)

## Summary

This fixes #174635 

### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
bryce-b authored Jan 12, 2024
1 parent fe57319 commit 7891a95
Showing 1 changed file with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { i18n } from '@kbn/i18n';
import React, { ReactNode, useRef, useState, useEffect } from 'react';
import { euiStyled } from '@kbn/kibana-react-plugin/common';
import { useTheme } from '../../../../../../hooks/use_theme';
import { isRumAgentName } from '../../../../../../../common/agent_name';
import {
isMobileAgentName,
isRumAgentName,
} from '../../../../../../../common/agent_name';
import {
TRACE_ID,
TRANSACTION_ID,
Expand Down Expand Up @@ -335,6 +338,18 @@ function RelatedErrors({
kuery += ` and ${TRANSACTION_ID} : "${item.doc.transaction?.id}"`;
}

const mobileHref = apmRouter.link(
`/mobile-services/{serviceName}/errors-and-crashes`,
{
path: { serviceName: item.doc.service.name },
query: {
...query,
serviceGroup: '',
kuery,
},
}
);

const href = apmRouter.link(`/services/{serviceName}/errors`, {
path: { serviceName: item.doc.service.name },
query: {
Expand All @@ -349,7 +364,7 @@ function RelatedErrors({
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
<div onClick={(e: React.MouseEvent) => e.stopPropagation()}>
<EuiBadge
href={href}
href={isMobileAgentName(item.doc.agent.name) ? mobileHref : href}
color={theme.eui.euiColorDanger}
iconType="arrowRight"
>
Expand Down

0 comments on commit 7891a95

Please sign in to comment.