Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search results link spans #536

Merged

Conversation

everett980
Copy link
Collaborator

Which problem is this PR solving?

Short description of the changes

  • SearchTracePage/url parses span into spanLinks and traceID (unchanged: traceID is used to fetch traces instead of searching)
  • spanLinks are given to SearchResults to pass a uiFind value to the TracePage (unchanged: this is how deep linking into TracePage already behaves)

@codecov
Copy link

codecov bot commented Mar 3, 2020

Codecov Report

Merging #536 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #536      +/-   ##
==========================================
+ Coverage   92.85%   92.93%   +0.07%     
==========================================
  Files         197      197              
  Lines        4814     4840      +26     
  Branches     1162     1174      +12     
==========================================
+ Hits         4470     4498      +28     
+ Misses        303      302       -1     
+ Partials       41       40       -1
Impacted Files Coverage Δ
.../components/SearchTracePage/SearchResults/index.js 80.76% <ø> (ø) ⬆️
...-ui/src/components/TracePage/url/ReferenceLink.tsx 100% <ø> (ø) ⬆️
...s/jaeger-ui/src/components/SearchTracePage/url.tsx 100% <100%> (+20%) ⬆️
.../jaeger-ui/src/components/SearchTracePage/index.js 88.13% <100%> (ø) ⬆️
...s/jaeger-ui/src/components/TracePage/url/index.tsx 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 916b2ae...24f68a4. Read the comment docs.

[trace0]: span0,
},
})
).toBe(`/search?span=${span0}%40${trace0}&traceID=${trace2}`);
Copy link

@guo0693 guo0693 Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI, in our use case, you won't find a mix of span@trace1&traceId=${trace2}, it's OK for UI can support that.
We should add a test case for:

${span1_1}%20${span1_2}%40${trace1}
&${span2_1}%40${trace2}
&%40${trace3}

Notice trace3 has empty spanIds

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realize spanIDs were optional.
I added a check & a test for that.

@@ -45,7 +45,7 @@ describe(ReferenceLink, () => {

it('render for external trace', () => {
const component = shallow(<ReferenceLink reference={externalRef} focusSpan={focusMock} />);
const link = component.find('a[href="/trace/trace2/uiFind?=span2"]');
const link = component.find('a[href="/trace/trace2?uiFind=span2"]');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

import prefixUrl from '../../../utils/prefix-url';

import { TNil } from '../../../types';

export const ROUTE_PATH = prefixUrl('/trace/:id');

export function getUrl(id: string) {
return prefixUrl(`/trace/${id}`);
export function getUrl(id: string, uiFind?: string): string {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very familiar with tsx syntax, is "uiFind?" expected with "?"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ? just means it's optional. not all trace urls are deep links.

).toBe(`/search?traceID=${trace0}`);
});

it('converts spanLink and traceID to traceID and span', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to traceID and span or just to span?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@everett980 everett980 merged commit d7bbc7b into jaegertracing:master Mar 4, 2020
@everett980 everett980 deleted the search-results-link-spans branch March 4, 2020 21:11
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
* Add span linking to search results
* Add more url tests
* Change span csv to space seperated value
* Handle span param without spanIDs

Signed-off-by: Everett Ross <[email protected]>

Signed-off-by: vvvprabhakar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deep link spans from the trace search page
3 participants