Skip to content

Commit

Permalink
[APM] Fix deduplication for focused service maps (#61580)
Browse files Browse the repository at this point in the history
Closes #61292.

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
dgieselaar and elasticmachine authored Mar 28, 2020
1 parent 808dc85 commit 47184fb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,21 @@ describe('dedupeConnections', () => {
// @ts-ignore
expect(nodejsNode?.data[SPAN_SUBTYPE]).toBe('aa');
});

it('processes connections without a matching "service" aggregation', () => {
const response: ServiceMapResponse = {
services: [javaService],
discoveredServices: [],
connections: [
{
source: javaService,
destination: nodejsService
}
]
};

const { elements } = dedupeConnections(response);

expect(elements.length).toBe(3);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function dedupeConnections(response: ServiceMapResponse) {
serviceName = node[SERVICE_NAME];
}

const matchedServiceNodes = services.filter(
const matchedServiceNodes = serviceNodes.filter(
serviceNode => serviceNode[SERVICE_NAME] === serviceName
);

Expand Down

0 comments on commit 47184fb

Please sign in to comment.