mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
90176853c7
commit
0e330a80d4
4 changed files with 9 additions and 9 deletions
|
@ -191,7 +191,7 @@ describe('waterfall_helpers', () => {
|
|||
name: 'SELECT FROM products',
|
||||
id: 'mySpanIdB'
|
||||
},
|
||||
child_ids: ['mySpanIdA', 'mySpanIdC']
|
||||
child: { id: ['mySpanIdA', 'mySpanIdC'] }
|
||||
} as Span,
|
||||
{
|
||||
parent: { id: 'mySpanIdD' },
|
||||
|
@ -294,7 +294,7 @@ describe('waterfall_helpers', () => {
|
|||
name: 'SELECT FROM products',
|
||||
id: 'mySpanIdB'
|
||||
},
|
||||
child_ids: ['incorrectId', 'mySpanIdC']
|
||||
child: { id: ['incorrectId', 'mySpanIdC'] }
|
||||
} as Span,
|
||||
{
|
||||
parent: { id: 'mySpanIdD' },
|
||||
|
|
|
@ -237,7 +237,7 @@ const getWaterfallItems = (items: TraceAPIResponse['trace']['items']) =>
|
|||
});
|
||||
|
||||
/**
|
||||
* Changes the parent_id of items based on the child_ids property.
|
||||
* Changes the parent_id of items based on the child.id property.
|
||||
* Solves the problem of Inferred spans that are created as child of trace spans
|
||||
* when it actually should be its parent.
|
||||
* @param waterfallItems
|
||||
|
@ -245,10 +245,10 @@ const getWaterfallItems = (items: TraceAPIResponse['trace']['items']) =>
|
|||
const reparentSpans = (waterfallItems: IWaterfallItem[]) => {
|
||||
return waterfallItems.map(waterfallItem => {
|
||||
if (waterfallItem.docType === 'span') {
|
||||
const { child_ids: childIds } = waterfallItem.doc;
|
||||
if (childIds) {
|
||||
childIds.forEach(childId => {
|
||||
const item = waterfallItems.find(_item => _item.id === childId);
|
||||
const childId = waterfallItem.doc.child?.id;
|
||||
if (childId) {
|
||||
childId.forEach(id => {
|
||||
const item = waterfallItems.find(_item => _item.id === id);
|
||||
if (item) {
|
||||
item.parentId = waterfallItem.id;
|
||||
}
|
||||
|
|
|
@ -2027,7 +2027,7 @@ export const inferredSpans = {
|
|||
id: '41226ae63af4f235',
|
||||
type: 'unknown'
|
||||
},
|
||||
child_ids: ['8d80de06aa11a6fc']
|
||||
child: { ids: ['8d80de06aa11a6fc'] }
|
||||
},
|
||||
{
|
||||
container: {
|
||||
|
|
|
@ -54,5 +54,5 @@ export interface SpanRaw extends APMBaseDoc {
|
|||
id: string;
|
||||
};
|
||||
observer?: Observer;
|
||||
child_ids?: string[];
|
||||
child?: { id: string[] };
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue