Skip to content

Commit

Permalink
DDG: Remove kind.server filter and handle service calling itself
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Vargas <[email protected]>
  • Loading branch information
rubenvp8510 committed Apr 4, 2020
1 parent 4589298 commit c9bb9ea
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions packages/jaeger-ui/src/model/ddg/transformTracesToPaths.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,24 @@ function transformTracesToPaths(
return !span.hasChildren;
})
.forEach(leaf => {
const spans = spanAncestorIds(leaf).map(id => {
const spans = spanAncestorIds(leaf).reduce((acumulator: Span[], id: string): Span[] => {
const span = spanMap.get(id);
if (!span) throw new Error(`Ancestor spanID ${id} not found in trace ${traceID}`);
return span;
});
if (acumulator.length > 0) {
const headSpan = acumulator[acumulator.length - 1];
if (headSpan.processID === span.processID) {
return acumulator;
}
}
acumulator.push(span);
return acumulator;
}, []);
spans.reverse();
spans.push(leaf);

const path: TDdgPayloadEntry[] = spans
.filter(span => span.tags.find(({ key, value }) => key === 'span.kind' && value === 'server'))
.map(({ processID, operationName: operation }) => ({
service: data.processes[processID].serviceName,
operation,
}));
const path: TDdgPayloadEntry[] = spans.map(({ processID, operationName: operation }) => ({
service: data.processes[processID].serviceName,
operation,
}));

if (
path.some(
Expand Down

0 comments on commit c9bb9ea

Please sign in to comment.