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

feat: Add autopop parameter, Add debug loggings #2459

Merged
merged 9 commits into from
Feb 28, 2020
Merged

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 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

packages/apm/src/integrations/tracing.ts Outdated Show resolved Hide resolved
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.

CHANGELOG.md Outdated Show resolved Hide resolved
packages/apm/src/integrations/tracing.ts Outdated Show resolved Hide resolved
@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.

3 participants