jaeger-ui
jaeger-ui copied to clipboard
Add optional tag actions
Which problem is this PR solving?
- Resolves #729
Short description of the changes
- Add the ability to configure custom actions for tags, services and processes by adding a function to the UI-config
- Add a configurable link to the link patterns config section
https://user-images.githubusercontent.com/3125539/119652907-5bee0d00-be2f-11eb-9010-09b5d9b037c7.mov
config used in the example:
"tagsActions": [{
title: 'this link was configured in the ui-config',
action: function(tag, span) {
const { key, value } = tag;
const url = `/search?service=${span.process.serviceName}&tags={"${key}":"${value}"}`;
window.open(url);
}
},{
title: 'display an alert',
icon: 'setting',
action: function(tag, span) {
alert(JSON.stringify(span))
}
}]
Codecov Report
Merging #759 (9a9ab5d) into master (c618bf6) will decrease coverage by
0.12%
. The diff coverage is58.33%
.
@@ Coverage Diff @@
## master #759 +/- ##
==========================================
- Coverage 95.10% 94.98% -0.13%
==========================================
Files 230 230
Lines 7010 7021 +11
Branches 1745 1749 +4
==========================================
+ Hits 6667 6669 +2
- Misses 337 346 +9
Partials 6 6
Impacted Files | Coverage Δ | |
---|---|---|
...mponents/TracePage/TraceTimelineViewer/SpanBar.tsx | 100.00% <ø> (ø) |
|
...e/TraceTimelineViewer/SpanDetail/AccordianText.tsx | 100.00% <ø> (ø) |
|
...TracePage/TraceTimelineViewer/SpanDetail/index.tsx | 100.00% <ø> (ø) |
|
packages/jaeger-ui/src/model/link-patterns.tsx | 92.70% <ø> (-1.86%) |
:arrow_down: |
.../TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx | 85.36% <44.44%> (-11.70%) |
:arrow_down: |
...ceTimelineViewer/SpanDetail/AccordianKeyValues.tsx | 100.00% <100.00%> (ø) |
|
...e/TraceTimelineViewer/SpanDetail/AccordianLogs.tsx | 100.00% <100.00%> (ø) |
|
...nents/TracePage/TraceTimelineViewer/SpanBarRow.tsx | 94.44% <0.00%> (-5.56%) |
:arrow_down: |
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 c618bf6...9a9ab5d. Read the comment docs.
Please make sure all commits are signed per contributing guide.
I like the functionality, except for the legend:
I think the legend is misplaced since it implies that the end user of the UI can actually go and configure the links, which is not the case in a typical enterprise setup.
I think this might also need a future extension to allow setting some filters on the individual tag actions, to be able to control which tags they should apply to. In fact, could we avoid introducing a new top-level section to the config but instead integrate this into the existing LinkPatterns configuration, which already supports selection of tags? We could extend it to make the selection optional or "*"
@yurishkuro sorry for getting back to this PR so late
I like the functionality, except for the legend: I think the legend is misplaced since it implies that the end user of the UI can actually go and configure the links, which is not the case in a typical enterprise setup.
this is a link to the link-patterns docs which can be overridden in the config
I think this might also need a future extension to allow setting some filters on the individual tag actions, to be able to control which tags they should apply to. In fact, could we avoid introducing a new top-level section to the config but instead integrate this into the existing LinkPatterns configuration, which already supports selection of tags? We could extend it to make the selection optional or "*"
we can avoid another top-level section in the config and use a "select all" option such as "*". please note that we only display those links when a user hovers the tag as opposed to other links which are always displayed.
@esnible, what do you think about this from a UX perspective?
@yoave23 are you still interested in finishing this PR?