[APM] change span property name from child_ids to child.id (#64209)
This commit is contained in:
parent
4d979930aa
commit
bb89b6a48c
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: {
|
||||
|
|
|
@ -52,5 +52,5 @@ export interface SpanRaw extends APMBaseDoc {
|
|||
id: string;
|
||||
};
|
||||
observer?: Observer;
|
||||
child_ids?: string[];
|
||||
child?: { id: string[] };
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue