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

Support trace-scoped external links similar to tag links #480

Merged
merged 10 commits into from
Dec 10, 2019

Conversation

rubenvp8510
Copy link
Collaborator

@rubenvp8510 rubenvp8510 commented Nov 6, 2019

Signed-off-by: Ruben Vargas ruben.vp8510@gmail.com

Which problem is this PR solving?

Short description of the changes

  • Now render a link on the header title in traceview if external links is configured.

Screenshot from 2019-11-12 15-56-37
Screenshot from 2019-11-12 15-55-46

@codecov
Copy link

codecov bot commented Nov 6, 2019

Codecov Report

Merging #480 into master will increase coverage by 0.04%.
The diff coverage is 93.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #480      +/-   ##
==========================================
+ Coverage   92.74%   92.79%   +0.04%     
==========================================
  Files         193      194       +1     
  Lines        4672     4702      +30     
  Branches     1126     1132       +6     
==========================================
+ Hits         4333     4363      +30     
  Misses        299      299              
  Partials       40       40
Impacted Files Coverage Δ
packages/jaeger-ui/src/model/link-patterns.tsx 94.44% <100%> (+2.89%) ⬆️
...ents/TracePage/TracePageHeader/TracePageHeader.tsx 96.42% <50%> (-3.58%) ⬇️
.../jaeger-ui/src/components/common/ExternalLinks.tsx 88.88% <88.88%> (ø)
...eViewer/TimelineHeaderRow/TimelineViewingLayer.tsx 89.83% <0%> (+1.69%) ⬆️

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 1ee0cf1...c39d6e6. Read the comment docs.

@yurishkuro
Copy link
Member

Implements external links at trace level (Issue 465)

If it resolves that issue, please include text Resolves #465 in the description to enable auto-close.

Please include sample screenshots.

How are these links configured by the end user? Please create a documentation PR to add it to https://www.jaegertracing.io/docs/1.14/frontend-ui/

@rubenvp8510
Copy link
Collaborator Author

Attached screenshots.

@everett980
Copy link
Collaborator

Can you update the type in types/config.tsx? Unfortunately, due to _get, it doesn't currently matter, but I plan on fixing that.
Also, it serves as a form of documentation, in addition to what Yuri linked.

@rubenvp8510
Copy link
Collaborator Author

Can you update the type in types/config.tsx? Unfortunately, due to _get, it doesn't currently matter, but I plan on fixing that.
Also, it serves as a form of documentation, in addition to what Yuri linked.

Added.

@yurishkuro
Copy link
Member

@everett980 is this ready to merge?

Copy link
Collaborator

@everett980 everett980 left a comment

Choose a reason for hiding this comment

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

Thanks for the pr @rubenvp8510, sorry it took me so long to get to it!

It mostly looks good, aside from simplifying the caching strategy which is admittedly based off of an existing function. That and some minor TS changes and some props that seem unused.

@@ -0,0 +1,47 @@
// Copyright (c) 2017 Uber Technologies, Inc.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please update year to 2019

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

😳

Copy link
Member

Choose a reason for hiding this comment

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

if this is a brand new file/code, the copyright should be The Jaeger Authors

Copy link
Collaborator

Choose a reason for hiding this comment

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

@yurishkuro when did this change? should any existing files be updated from "Uber Technologies, Inc." to "The Jaeger Authors"?
Also, the CONTRIBUTING.md#license should probably mention to use the current year, right?

Copy link
Member

Choose a reason for hiding this comment

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

It's always been the guideline. The link also says Jaeger Authors.

Yes, we might fix the year there so that people can copy & paste, although a preferred way is to auto-generate the headers like we do in the other repos (e.g. make fmt adds them).


type ExternalLinksProps = {
links: Link[];
children?: React.ReactNode;
Copy link
Collaborator

Choose a reason for hiding this comment

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

what children should this component expect? the use case above does not seem to provide children.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@rubenvp8510 are there any expected children? If not, this prop and its consumption in render can be removed.

packages/jaeger-ui/src/components/common/ExternalLinks.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/model/link-patterns.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/model/link-patterns.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/model/link-patterns.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/model/link-patterns.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/model/link-patterns.tsx Outdated Show resolved Hide resolved
@rubenvp8510
Copy link
Collaborator Author

I've already address all comments here. Ready for another review!

@rubenvp8510 rubenvp8510 force-pushed the links-trace branch 2 times, most recently from 2cdb9c0 to 315c94c Compare December 6, 2019 20:05
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
@rubenvp8510
Copy link
Collaborator Author

Done!

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Copy link
Collaborator

@everett980 everett980 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@everett980 everett980 merged commit 5f2a05d into jaegertracing:master Dec 10, 2019
@yurishkuro
Copy link
Member

🎉

@rwkarg
Copy link

rwkarg commented Dec 13, 2019

Is there an example on how to configure this?

@pathikritmodak
Copy link

pathikritmodak commented Feb 18, 2020

Any example or documentation around this would help. We are planning to use this.
@rubenvp8510 can you please add docs or example as well.

@rubenvp8510 rubenvp8510 deleted the links-trace branch February 18, 2020 20:50
@rubenvp8510 rubenvp8510 restored the links-trace branch February 18, 2020 20:50
@rubenvp8510
Copy link
Collaborator Author

@rwkarg @pathikritmodak

Sorry, I haven't had a chance to write documentation about this. I'll send a PR today. You can add trace links to your traces adding an entry into linkPatterns node of the UI config with type= 'traces'

here is an example:


linkPatterns: [
  {
    type: 'traces',
    url : 'http://localhost:8080/more?traceId=#{traceID}',
    text : "External Link to #{traceID}"
  },
  {
    type: 'traces',
    url : 'http://localhost/stats/more?traceId=#{traceID}',
    text : "Other external to #{traceName}"
  }
],

Both url and text can be defined as templates (i.e. using #{field-name}) (same as other linkPatterns). Supported template fields: duration, endTime, startTime,traceName, traceID

vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
Support trace-scoped external links similar to tag links
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
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.

Support trace-scoped external links similar to tag links
5 participants