sentry-javascript icon indicating copy to clipboard operation
sentry-javascript copied to clipboard

Make heartbeat interval configurable

Open danizord opened this issue 2 years ago • 4 comments

Problem Statement

I have a pageload transaction that normally should take 30s+ to finish, but IdleTransaction's heartbeat is finishing the transaction before the page content is fully loaded.

Solution Brainstorm

Make heartbeat interval configurable

danizord avatar Apr 12 '22 19:04 danizord

I believe this is already possible by using the idleTimeout option of the BrowserTracing integration. You can read more about it here: https://docs.sentry.io/platforms/javascript/performance/instrumentation/automatic-instrumentation/#idletimeout

Let me know if this fits your case!

lforst avatar Apr 13 '22 09:04 lforst

I believe this is already possible by using the idleTimeout option of the BrowserTracing integration. You can read more about it here: https://docs.sentry.io/platforms/javascript/performance/instrumentation/automatic-instrumentation/#idletimeout

Let me know if this fits your case!

Unfortunately not. Even if I configure 60s as idleTimeout, after 15s (3 heartbeats) with the same activity count, it finishes the transaction.

danizord avatar Apr 13 '22 09:04 danizord

Ah yeah you are right. The amount of heartbeats and their intervals are currently hardcoded. I'll backlog this and take it to the team. Thanks for writing in!

By the way, feel free to open a PR! :) We'll look over it and assist in writing tests and documentation.

lforst avatar Apr 13 '22 10:04 lforst

Nice! Added to my backlog as well :D Thanks!

danizord avatar Apr 13 '22 11:04 danizord