Skip to content

Conversation

@HazAT
Copy link
Member

@HazAT HazAT commented Feb 28, 2020

This PR adds a new parameter to pushActivity as a fallback to auto finish never finishing spans.

If someone starts an activity (span) and it never finishes, the transaction will never be flushed unless a navigation change happens. By providing the autoPopAfterMs parameter in pushActivity we have an idle timeout to finish the span regardless.
If this timeout kicks in, we mark the span with DeadlineExceeded status so it's clear this is an error in the users application and the span was never finished.

This happens on sentry.io in our React Profiler for measuring rendering times, sometimes it happens that finishProfile is never called and therefore we never pop the activity (finish the span).

Debug logging example:
image

@HazAT HazAT requested a review from kamilogorek as a code owner February 28, 2020 08:38
@HazAT HazAT self-assigned this Feb 28, 2020
@getsentry-bot
Copy link
Contributor

getsentry-bot commented Feb 28, 2020

Messages
📖

@sentry/browser bundle gzip'ed minified size: (ES5: 16.6973 kB) (ES6: 15.7109 kB)

📖 ✅ TSLint passed

Generated by 🚫 dangerJS against 6c34580

logger.log(`[Tracing] auto pop of: ${name}#${Tracing._currentIndex} in ${options.autoPopAfter}ms`);
const index = Tracing._currentIndex;
setTimeout(() => {
Tracing.popActivity(index, {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is popping same activity twice safe?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it doesn't do anything if it no longer exists.

@HazAT
Copy link
Member Author

HazAT commented Feb 28, 2020

Bump

@kamilogorek
Copy link
Contributor

Nope

@HazAT
Copy link
Member Author

HazAT commented Feb 28, 2020

wth github plz

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.

4 participants