• Facebook
  • Twitter
  • Gplus
  • Github
  • Mail
  • Login
    • Register
  • Blog
StrongLoop
  • Products & Services
    • API Connect
    • LoopBack
    • Support
    • Certification
    • Consulting
    • Training
  • Get Started
  • Pricing
  • Documentation
    • Documentation – IBM API Connect
    • Documentation – LoopBack Framework
  • Developers
    • LoopBack
    • Modules
    • Express
    • Testimonials
    • Performance Tips
    • For Java, Rails, PHP and .NET Developers
    • Node Infographic
    • Events
    • Videos
    • Forums
  • Search

Announcing Transaction Tracing for Node.js Beta

June 23, 2015/in Arc, How-To, Node DevOps, Product /by Al Tsang
Share

At StrongLoop, we develop tools to support development and operations throughout the entire lifecycle of API development. Initially, we released Arc Profiler to help you understand performance characteristics of your Node application. Next, we added Arc Metrics to provide real-time visibility into your staging and production environments. Today we’re announcing the latest Arc module, Tracing, (currently in public Beta) that enables you to perform root cause analysis and triage incidents in production. (You can watch a short overview and demo of the Tracing module here.)

Those who have cut their teeth on the seemingly endless iterations in the dev lifecycle  will understand this satirical spin on Dorothy’s line from the Wizard of Oz:

“Toto, I don’t think we’re in staging anymore…  There’s no place like production… There’s no place like production…”

Simulated load, automated testing, and all the CI magic in the world won’t prepare you for the “gotchas” that can happen in production.  If you’re lucky, you’ll have a canary that keels over as soon as you enter the production mine.  But what then?

The answer is Tracing.  The Arc Tracing module provides the ability to call in the artillery when you need it.  If you see something of interest in Metrics, open up Tracing and you’ll be shown a timeline of memory and CPU usage.

Understanding the Timeline

tracing21

Locate the point of interest—more often than not a CPU or memory spike in the form of a peak in the line—and start to drill down. When you’ve located the incident, you’ll want to freeze the time slice by clicking on the chart drawing your black line denoting a time slice and starting your drill down.

Level 1: Trace sequences

tracing22

The first level you’ll  see when drilling down is a listing of trace sequences.  If you think about the tiers of your application architecture,  trace sequences represent these tiers where your application may be misbehaving.

Consider a web application using single-page application architecture: You have your client running its client MVC (JavaScript-based if you’re running in a browser), talking to REST backend – none other than running LoopBack of course!  That in turn is persisting data to MySQL or some other persistent data store. We can break down each of these tiers as a trace sequence incurring computing resources:

  1. Spent on generating the request from the client.
  2. Receiving the client request and running and business logic within the Node.js based API tier.
  3. Querying and or updating the persistent store.

In the screenshot above, the Node.js app is serving up a HTTP response to a GET request and that’s the only operation it does to consume computing resources.

Level 2: Waterfalls

tracing23

The second level of the drilldown will give you sense of how much code is running synchronously vs asynchronously. Why?  Because you’ll want to quickly rule out any of the usual suspects that bog down the Node application. How many times have you thought you required a module that runs operations asynchronously with a callback only to find out that behind the scenes it was blocking synchronously and serially for a set of operations? Waterfalls stitch together time spent in code across asynchronous boundaries.

A waterfall consists of two parts represented as separate bars:

  1. Top Bar – time executing the function call
  2. Bottom Bar – time spent executing the callback function

While hovering over each waterfall bar, you can view its corresponding details in the Inspector pane on the right. As you can see in the screenshot above – the culprit for the memory leak is the aptly named – LeakyClass.

Level 3: Flame graph and call stack trace

tracing24

The third and final level provides a visualization in the form of a flame graph. A flame graph represents  all function calls and callbacks depicted in the classic pineapple upside cake (in our case, it’s right-side up) with the encapsulating function at the bottom and it’s nested calls stacked on top. Each Node module is color coded differently.  The flame graph will show you where time is spent within the application. The screenshot above shows various Express functions culminating in the LeakyClass module.

tracing25

The function call stack trace is also shown in tree form as well below the flame graph. If you hover over the flame graph, it’ll highlight the corresponding function line on the tree and vice versa.

Conclusion

A couple of things you should know:

  1. Tracing incurs 10-15% overhead on your processes.
  2. Tracing occurs in 20 second intervals and can display up to 5 hours on the timeline.
  3. Trace Sequences have been augmented with the same Strong Agent probes utilized in Arc Metrics.  This means that we can show you time spent in MySQL, PostgreSQL, Oracle, Redis, MongoDB, Memcached, and Memcache.

What’s next?

  • Get started with transaction tracing by signing up for StrongLoop Arc and unlocking the tracing module by contacting us at callback@strongloop.com.
  • Read the in-depth “Node.js Transaction Tracing by Example” blog
  • Want to see the tracing module in action? Sign up for our free “Node.js Transaction Tracing” webinar happening on Friday, June 26 at 10 AM Pacific.
  • Learn more about how tracing works in the official documentation.

 

Share
Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on Google+
  • Share on Pinterest
  • Share on Linkedin
  • Share on Tumblr
  • Share on Vk
  • Share on Reddit
  • Share by Mail

< Previous Post

Next Post >

Questions?

Contact us
for training and professional services to see how Node.js can accelerate your mobile, IoT and next-generation web APIs.

Recent Posts

  • Creating a Multi-Tenant Connector Microservice Using LoopBackApril 25, 2017 - 7:00 am
  • Systematic Data Design in JavaScript – Featuring Three Data TypesApril 18, 2017 - 7:35 am
  • Announcing LoopBack.next, the Next Step to Make LoopBack Effortlessly ExtensibleApril 13, 2017 - 8:15 am

Categories

  • API Connect (19)
  • api microgateway (1)
  • API Tip (13)
  • Arc (24)
  • BACN (3)
  • Case Studies (3)
  • Cloud (10)
  • Community (263)
  • Espanol (7)
  • Events (38)
  • Express (21)
  • How-To (164)
  • JavaScript Language (21)
    • ES2015/ES6 (6)
  • LoopBack (133)
  • Mobile (30)
  • News (125)
  • Node core (14)
  • Node DevOps (26)
  • Node.js v0.12 (17)
  • Performance Tip (11)
  • Portuguese (31)
  • Press (14)
  • Product (29)
    • API Gateway (2)
  • Resources (8)
  • StrongNode (7)
  • Uncategorized (2)

Archives

  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • November 2013
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • April 2013
  • March 2013

Compose APIs, Build, Deploy and Monitor Node

Install API Connect

$ npm install -g apiconnect

Create your API Connect project

$ apic loopback

Launch API Designer

$ cd your-project

$ apic edit

API Designer will run on your local browser

An IBM BlueMix account is required to use the Designer. Register for IBM Bluemix

Click To Get Started

get_started

It’s FREE!

Company

  • Partners
  • Careers
  • Contact us

Products

  • API Connect
  • LoopBack Framework
  • API Connect FAQs

Content & News

  • Blog
  • Newsletter
  • Videos
  • Events
  • Infographic

Contact Us

  • Email
  • Twitter
  • GitHub
  • Facebook
  • Google+

Legal

  • Privacy Policy
  • Terms of Use
  • License
© 2016 - IBM Corporation. All rights reserved.
StrongLoop Node.js Tracing Quickstart Como fazer deploy de aplicações Express com o Gerenciador Processos Stron...
Scroll to top