jaeger-ui icon indicating copy to clipboard operation
jaeger-ui copied to clipboard

Add optional tag actions

Open yoave23 opened this issue 3 years ago • 5 comments

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))
          }
        }]

yoave23 avatar May 26 '21 11:05 yoave23

Codecov Report

Merging #759 (9a9ab5d) into master (c618bf6) will decrease coverage by 0.12%. The diff coverage is 58.33%.

Impacted file tree graph

@@            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.

codecov[bot] avatar May 26 '21 11:05 codecov[bot]

Please make sure all commits are signed per contributing guide.

I like the functionality, except for the legend: image 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 avatar May 26 '21 22:05 yurishkuro

@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.

yoave23 avatar Jul 29 '21 09:07 yoave23

@esnible, what do you think about this from a UX perspective?

jpkrohling avatar Jul 29 '21 12:07 jpkrohling

@yoave23 are you still interested in finishing this PR?

yurishkuro avatar Oct 23 '22 04:10 yurishkuro