Skip to content

Commit

Permalink
[APM] Diplay logs only matching trace.id query (#136927)
Browse files Browse the repository at this point in the history
* [APM] Diplay logs only matching `trace.id` query

* Fix log stream query

* Update unit tests
  • Loading branch information
kpatticha authored Aug 1, 2022
1 parent 6737428 commit 1e56f9b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function LogsTabContent({ transaction }: { transaction: Transaction }) {
logView={{ type: 'log-view-reference', logViewId: 'default' }}
startTimestamp={startTimestamp - 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}
columns={[
{ type: 'timestamp' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('Transaction action menu', () => {
{
key: 'traceLogs',
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,
},
],
Expand Down Expand Up @@ -122,7 +122,7 @@ describe('Transaction action menu', () => {
{
key: 'traceLogs',
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,
},
],
Expand Down Expand Up @@ -188,7 +188,7 @@ describe('Transaction action menu', () => {
{
key: 'traceLogs',
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,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const getSections = ({
path: `/link-to/logs`,
query: {
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ describe('TransactionActionMenu component', () => {
expect(
(getByText('Trace logs').parentElement as HTMLAnchorElement).href
).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)'
);
});

Expand Down

0 comments on commit 1e56f9b

Please sign in to comment.