Skip to content
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

[apm]Spans missing from waterfall post 6.x upgrade #52385

Closed
wants to merge 5 commits into from

Conversation

cauemarcondes
Copy link
Contributor

@cauemarcondes cauemarcondes commented Dec 6, 2019

When upgrading from 6.x to 7.x the migration assistant will not apply a parent.id to transactions/spans. The UI currently expects parent.id to be available and uses it to build the parent/child relationship. However, if no parent.id exists the trace items (transactions and spans) should instead be ordered by start time.

Screenshot 2019-12-10 at 13 51 37

Screenshot 2019-12-10 at 10 00 58

closes #52252

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@@ -157,7 +157,8 @@ describe('waterfall_helpers', () => {
transaction: {
duration: { us: 49660 },
name: 'GET /api',
id: 'myTransactionId1'
id: 'myTransactionId1',
start: { us: 1000 }
Copy link
Member

@sorenlouv sorenlouv Dec 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think start has been deprecated for timestamp.us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the problem is that timestamp.us is not correct on legacy spans please add warning comments when where start is defined to ensure we don't use it by mistake in later versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔Shouldn't it be used to create the timestamp when I ran the index migration process? Because the only way to align right the spans is with the start.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd expect the migration script to have handled this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try asking @graphaelli - I think he worked on the migration script.

);
}
});
const waterfallItems = transformTraceItems({ trace, errorsPerTransaction });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

transformTraceItems is very generic. I think getWaterfallItems is slightly better. But if you can find something more precise than "waterfall item" I'd be very happy.

That being said, i thought about dropping this entirely and just having regular spans and transactions. Problem with that is that we'll need some custom fields like skew and offset. And instead of mutating the span and transaction docs it seemed better to create a new "thing" which became waterfallItem.

...toQuery(location.search),
...{
flyoutDetailTab: undefined,
waterfallItemId: item ? String(item.id) : undefined
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think item.id is always a string, so this might not be necessary anymore (not 100% so please double check).

You should therefore be able to do:

interface IWaterfallItemBase {
-  id: string | number;
+  id: string;

case 'span':
const parentTransaction = waterfall.getTransactionById(
currentItem.parentId
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about just adding the parent to each waterfall item? I don't expect this to cost a lot in increased memory since it'll just be pointers to transactions that are already in memory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to say: this will allow us to remove getTransactionById which is good because it decreases the API of waterfall helpers.

@@ -119,7 +122,7 @@ const createApmApi = () => {
.add(serviceMapRoute)

// Transaction
.add(transactionByTraceIdRoute);
.add(rootTransactionByTraceIdRoute);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This belongs in the "Traces" section

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cauemarcondes
Copy link
Contributor Author

This was replaced by: #52763

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[APM] Change get transaction by trace id url
3 participants