Skip to content

fix: Provide better descriptions for the performance navigation timing spans #3245

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

Merged
merged 4 commits into from
Apr 1, 2021

Conversation

dashed
Copy link
Member

@dashed dashed commented Feb 9, 2021

Screenshot provided by Rodolfo B.:

Screenshot 2021-02-09 at 14 57 35

Today performance navigation timing spans are created with descriptions that do not match the following diagram (specifically in regions outlined in magenta):

Screen Shot 2021-02-09 at 11 22 57 AM

The descriptions for these spans use the event name which may not be sufficient. Thus, we rename some as follows:

  • "secureConnection" to "secureConnection (TLS)"
  • "fetch" to "cache"
  • "domainLookup" to "DNS"

What it looks like:

Screen Shot 2021-02-18 at 3 55 19 PM

@dashed dashed self-assigned this Feb 9, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2021

size-limit report

Path Size
@sentry/browser - CDN Bundle (gzipped) 20.51 KB (0%)
@sentry/browser - Webpack 21.37 KB (0%)
@sentry/react - Webpack 21.41 KB (0%)
@sentry/browser + @sentry/tracing - CDN Bundle (gzipped) 27.69 KB (+0.35% 🔺)

@dashed dashed requested review from a team and rhcarvalho February 9, 2021 19:46
Copy link
Contributor

@rhcarvalho rhcarvalho left a comment

Choose a reason for hiding this comment

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

I appreciate the improvement, thanks @dashed

addPerformanceNavigationTiming({ transaction, entry, event: 'loadEvent', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'connect', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'secureConnection', timeOrigin, eventEnd: 'connectEnd', description: 'secureConnection (TLS)' });
addPerformanceNavigationTiming({ transaction, entry, event: 'fetch', timeOrigin, eventEnd: 'domainLookupStart', description: 'cache' });
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this guaranteed to be coming from the browser cache?

Copy link
Member Author

Choose a reason for hiding this comment

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

"AppCache" is a deprecated browser feature:

But instead of referring it to "AppCache", I just used "cache" as a description. It seems that there are other cache mechanisms being used. See: w3c/resource-timing#256

addPerformanceNavigationTiming({ transaction, entry, event: 'connect', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'secureConnection', timeOrigin, eventEnd: 'connectEnd', description: 'secureConnection (TLS)' });
addPerformanceNavigationTiming({ transaction, entry, event: 'fetch', timeOrigin, eventEnd: 'domainLookupStart', description: 'cache' });
addPerformanceNavigationTiming({ transaction, entry, event: 'domainLookup', timeOrigin });
Copy link
Contributor

Choose a reason for hiding this comment

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

As per PR description, isn't this missing a description: 'DNS'?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added this back in.

addPerformanceNavigationTiming({ transaction, entry, event: 'domContentLoadedEvent', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'loadEvent', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'connect', timeOrigin });
addPerformanceNavigationTiming({ transaction, entry, event: 'secureConnection', timeOrigin, eventEnd: 'connectEnd', description: 'secureConnection (TLS)' });
Copy link
Contributor

Choose a reason for hiding this comment

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

@dashed do you have a link to where this one is spec'ed? secureConnection (TLS) looks kinda verbose compared to domainLookup -> DNS

Couldn't we say TLS/SSL? or TLS?

eventEnd?: string;
description?: string;
}): void {
const { transaction, entry, event, timeOrigin, eventEnd, description } = props;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it pay-off moving all args into a single object just to deconstruct it here?!

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh well, one advantage is being able to name an argument and omit others. 👍

@dashed dashed force-pushed the navigation-timing-descriptions branch from 94a7d03 to 3176e64 Compare February 18, 2021 20:32
@dashed dashed requested a review from rhcarvalho February 18, 2021 20:59
@dashed
Copy link
Member Author

dashed commented Feb 18, 2021

@rhcarvalho I've updated the PR description with the screenshot of the description changes.

Copy link

@alxu-sentry alxu-sentry left a comment

Choose a reason for hiding this comment

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

I'm not sure I understand the rationale behind this change. We don't have "processing" or "load" spans from your picture, so it's not like we're going totally consistent with that. The only current description I think is a little confusing is "fetch" meaning AppCache, but that's deprecated anyways, so should we be adding this stuff just for that?

@dashed
Copy link
Member Author

dashed commented Feb 19, 2021

@alxu-sentry this change is to make the descriptions of the spans we already instrument better.

The processing and load spans could be added later in the future.

@alxu-sentry
Copy link

@alxu-sentry this change is to make the descriptions of the spans we already instrument better.

The processing and load spans could be added later in the future.

mneh, i'm just a little skeptical that the new messages are actually an improvement though. in my personal opinion as a user "domainLookup" is more clear because it must be coming from the performance timing api. it doesn't matter that much though

Copy link
Contributor

@rhcarvalho rhcarvalho left a comment

Choose a reason for hiding this comment

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

Sorry for the huge delay, this got lost among other notifications.

Thanks @dashed!

@dashed dashed force-pushed the navigation-timing-descriptions branch from 3176e64 to e67b44a Compare April 1, 2021 14:06
@dashed dashed merged commit ce40962 into master Apr 1, 2021
@dashed dashed deleted the navigation-timing-descriptions branch April 1, 2021 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants