-
Notifications
You must be signed in to change notification settings - Fork 503
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
Make traceID, startTime, endTime, duration and traceName available for Link Patterns #1178
Make traceID, startTime, endTime, duration and traceName available for Link Patterns #1178
Conversation
…r process, tags and logs linkpatterns Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
ff9f39f
to
0318def
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
].map(processLinkPattern); | ||
|
||
const spans = [ | ||
{ depth: 0, process: {}, tags: [{ key: 'myKey', value: 'valueOfMyKey' }] }, | ||
{ depth: 1, process: {}, logs: [{ fields: [{ key: 'myOtherKey', value: 'valueOfMy+Other+Key' }] }] }, | ||
{ depth: 1, process: {}, tags: [{ key: 'myThirdKey', value: 'valueOfThirdMyKey' }] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seem redundant adding a new span, just add a new tag to one of the other spans
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - added a new to existing span.
{ | ||
type: 'tags', | ||
key: 'myThirdKey', | ||
url: 'http://example.com/?myKey1=#{myKey}&myKey=#{myThirdKey}&traceID=#{traceID}&startTime=#{startTime}', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's a good idea that you can reference trace-level attributes without qualification. I can see it for traceID
, but why does startTime
refer to trace-level and not span-level?
My preference would be to use trace.traceID
, trace.startTime
, etc. to clearly indicate the scope, not to try to infer it automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading more into the existing code I am not a big fan of how it automatically ascends into ancestor spans when looking for tags. #1179
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed - now trace level are accessible only with trace.<data>
qualification in template variables.
packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/VirtualizedTraceView.tsx
Show resolved
Hide resolved
I said it partial because the current change makes trace related data accessible to logs, process and tags link pattern types but not span related data. |
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
Codecov ReportBase: 95.26% // Head: 95.47% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1178 +/- ##
==========================================
+ Coverage 95.26% 95.47% +0.20%
==========================================
Files 243 243
Lines 7562 7575 +13
Branches 1895 1898 +3
==========================================
+ Hits 7204 7232 +28
+ Misses 351 336 -15
Partials 7 7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
it('calls getLinks with expected params', () => { | ||
const span = trace.spans[1]; | ||
instance.linksGetter(span, span.tags, 0); | ||
expect(getLinksSpy).toHaveBeenCalledWith(span, span.tags, 0, trace); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to validate the actual value returned, which, as I understand, is [{url, text}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find a clean way to initialize linkPatterns
for tests, so I exported the const processedLinks
in link-patterns.tsx
.
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, just a couple minor comments.
I didn't find a clean way to initialize linkPatterns for tests, so I exported the const processedLinks in link-patterns.tsx.
yeah, the API feels unnecessarily complicated, it could've just accepted processed patterns as optional arg, since the methods to process patterns are exported anyway.
const traceKV = getParameterInTrace(parameter.split('trace.')[1], trace); | ||
if (traceKV) { | ||
entry = traceKV; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const traceKV = getParameterInTrace(parameter.split('trace.')[1], trace); | |
if (traceKV) { | |
entry = traceKV; | |
} | |
entry = getParameterInTrace(parameter.split('trace.')[1], trace); |
getLinks.processedLinks.push(...origLinkPatterns); | ||
}); | ||
|
||
it('calls getLinks with expected params', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stale title
@@ -22,6 +22,7 @@ import { DEFAULT_HEIGHTS, VirtualizedTraceViewImpl } from './VirtualizedTraceVie | |||
import traceGenerator from '../../../demo/trace-generators'; | |||
import transformTraceData from '../../../model/transform-trace-data'; | |||
import updateUiFindSpy from '../../../utils/update-ui-find'; | |||
import * as getLinks from '../../../model/link-patterns'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit
import * as getLinks from '../../../model/link-patterns'; | |
import * as linkPatterns from '../../../model/link-patterns'; |
Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
Thanks! 🎉 Could you also make a PR in the documentation repo to describe this change in https://www.jaegertracing.io/docs/1.42/frontend-ui/#link-patterns ? |
Updating the documentation for the linkPatterns change done in jaeger ui in PR jaegertracing/jaeger-ui#1178 Signed-off-by: Kanahathi Mohideen <kpmfazal@gmail.com>
Which problem is this PR solving?
This change makes trace related keys like traceID, traceName, startTime, endTime and duration be available for Link Patterns.
It partially solves part of #578
Short description of the changes