[APM] Diplay logs only matching trace.id query (#136927)

* [APM] Diplay logs only matching `trace.id` query

* Fix log stream query

* Update unit tests
This commit is contained in:
Katerina Patticha 2022-08-01 12:09:39 +02:00 committed by GitHub
parent 6737428484
commit 1e56f9ba34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -128,7 +128,7 @@ function LogsTabContent({ transaction }: { transaction: Transaction }) {
logView={{ type: 'log-view-reference', logViewId: 'default' }} logView={{ type: 'log-view-reference', logViewId: 'default' }}
startTimestamp={startTimestamp - framePaddingMs} startTimestamp={startTimestamp - framePaddingMs}
endTimestamp={endTimestamp + framePaddingMs} endTimestamp={endTimestamp + framePaddingMs}
query={`trace.id:"${transaction.trace.id}" OR "${transaction.trace.id}"`} query={`trace.id:"${transaction.trace.id}" OR (not trace.id:* AND "${transaction.trace.id})"`}
height={640} height={640}
columns={[ columns={[
{ type: 'timestamp' }, { type: 'timestamp' },

View file

@ -55,7 +55,7 @@ describe('Transaction action menu', () => {
{ {
key: 'traceLogs', key: 'traceLogs',
label: 'Trace logs', label: 'Trace logs',
href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20(not%20trace.id:*%20AND%20%22123%22)',
condition: true, condition: true,
}, },
], ],
@ -122,7 +122,7 @@ describe('Transaction action menu', () => {
{ {
key: 'traceLogs', key: 'traceLogs',
label: 'Trace logs', label: 'Trace logs',
href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20(not%20trace.id:*%20AND%20%22123%22)',
condition: true, condition: true,
}, },
], ],
@ -188,7 +188,7 @@ describe('Transaction action menu', () => {
{ {
key: 'traceLogs', key: 'traceLogs',
label: 'Trace logs', label: 'Trace logs',
href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20%22123%22', href: 'some-basepath/app/logs/link-to/logs?time=1580986800&filter=trace.id:%22123%22%20OR%20(not%20trace.id:*%20AND%20%22123%22)',
condition: true, condition: true,
}, },
], ],

View file

@ -168,7 +168,7 @@ export const getSections = ({
path: `/link-to/logs`, path: `/link-to/logs`,
query: { query: {
time, time,
filter: `trace.id:"${transaction.trace.id}" OR "${transaction.trace.id}"`, filter: `trace.id:"${transaction.trace.id}" OR (not trace.id:* AND "${transaction.trace.id}")`,
}, },
}), }),
condition: true, condition: true,

View file

@ -88,7 +88,7 @@ describe('TransactionActionMenu component', () => {
expect( expect(
(getByText('Trace logs').parentElement as HTMLAnchorElement).href (getByText('Trace logs').parentElement as HTMLAnchorElement).href
).toEqual( ).toEqual(
'http://localhost/basepath/app/logs/link-to/logs?time=1545092070952&filter=trace.id:%228b60bd32ecc6e1506735a8b6cfcf175c%22%20OR%20%228b60bd32ecc6e1506735a8b6cfcf175c%22' 'http://localhost/basepath/app/logs/link-to/logs?time=1545092070952&filter=trace.id:%228b60bd32ecc6e1506735a8b6cfcf175c%22%20OR%20(not%20trace.id:*%20AND%20%228b60bd32ecc6e1506735a8b6cfcf175c%22)'
); );
}); });