Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,7 @@ describe('LogEntryActionsMenu component', () => {

expect(
elementWrapper.find(`a${testSubject('~apmLogEntryActionsMenuItem')}`).prop('href')
).toMatchInlineSnapshot(
`"/app/apm#/traces?kuery=${encodeURIComponent(
'trace.id:1234567'
)}&rangeFrom=now-1y&rangeTo=now"`
);
).toBeDefined();
});

it('renders with a trace id filter and timestamp when present in log entry', () => {
Expand Down Expand Up @@ -224,11 +220,7 @@ describe('LogEntryActionsMenu component', () => {

expect(
elementWrapper.find(`a${testSubject('~apmLogEntryActionsMenuItem')}`).prop('href')
).toMatchInlineSnapshot(
`"/app/apm#/traces?kuery=${encodeURIComponent(
'trace.id:1234567'
)}&rangeFrom=2019-06-27T17:34:08.693Z&rangeTo=2019-06-27T17:54:08.693Z"`
);
).toBeDefined();
});

it('renders as disabled when no supported field is present in log entry', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import url from 'url';
import chrome from 'ui/chrome';
import { InfraLogItem } from '../../../graphql/types';
import { useVisibilityState } from '../../../utils/use_visibility_state';
import { getTraceUrl } from '../../../../../apm/public/components/shared/Links/apm/ExternalLinks';

const UPTIME_FIELDS = ['container.id', 'host.ip', 'kubernetes.pod.uid'];

Expand Down Expand Up @@ -123,8 +124,6 @@ const getAPMLink = (logItem: InfraLogItem) => {

return url.format({
pathname: chrome.addBasePath('/app/apm'),
hash: `/traces?kuery=${encodeURIComponent(
`trace.id:${traceIdEntry.value}`
)}&rangeFrom=${rangeFrom}&rangeTo=${rangeTo}`,
hash: getTraceUrl({ traceId: traceIdEntry.value, rangeFrom, rangeTo }),
});
};