question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ending automatic transactions in a graceful way

See original GitHub issue

Our transaction end detection logic for all transactions type except page-load is a bit eager now and might fail to capture spans that happen in the frames that happen after the nextTick.

During the route-change events, there are multiple ways users would be invoking external API calls, can be sync, concurrent/parallel or even lazy load some components based on the API calls. Right now our framework integrations rely on the internal lifecycle events of the respective frameworks and tries to end the transaction as soon as the component is mounted to the DOM.

With this approach, we might be able to only capture only the API calls that are requested during the component mounting and might fail to capture calls that are done after the component is mounted to the DOM.

Solution

  • Instead of closing the transaction as soon as the children components are mounted or when the route change navigation is done, We could actively wait and listen for few frames (for now we can listen for 5 successive ticks/animation frames) and decide if we want to close the transaction.
  • If there are no calls within those 5 ticks, we close the transaction immediately and send it to the APM server.
  • If there are any spans, assume a call happens on the 3rd frame, then we schedule another 5 frames and end the transaction accordingly.
  • In order to reduce the noise in the transaction, our transaction would always get time shifted to the last active transaction. Ex - if there are 2 spans that happens in the 2nd tick after the transaction start, we end the transaction with the end time of the longest span and send it to the server.
  • With our filtering logic, transaction without any spans will not be reported to the server.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
vigneshshanmugamcommented, Nov 18, 2019

Had a quick look, it seems like a bug and I will create a new issue to track it. Thanks a lot @anotheri for providing lot of details 😃

0reactions
vigneshshanmugamcommented, Jan 21, 2020

Had a discussion with @jahtalab and we have agreed for wait for couple of frames and adjust the transaction end timings to previous time if no interesting events occur within the waited frames.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I stop automatic payments from my bank account?
Call and write your bank or credit union​​ Tell your bank that you have "revoked authorization" for the company to take automatic payments...
Read more >
Bill Pay Service FAQ – Recurring Payments
Answers to popular Bill Pay service questions, including costs, how to set up recurring payments, who you can pay, and more.
Read more >
How Autopay Can Protect Your Credit Score, Keep You ...
One simple way to protect your credit score is to put your bills on autopay. Here's an autopay strategy that can also keep...
Read more >
Grace Period Definition for Borrowers, How It Works, ...
A grace period is not the same as a deferment, in which a borrower may forgo payments due to financial hardship or other...
Read more >
Credit card autopay: How to get it right
Grace Pilling. Editor: ... “Automatic payments are a very useful tool,” she says. ... Autopay is an easy way to pay your credit...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found