Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Rails Support
      • Working with Bundler
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with the Play Framework
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Monitoring & Metrics
  • Node.js Language Metrics (Public Beta)

Node.js Language Metrics (Public Beta)

English — 日本語に切り替える

Last updated November 30, 2022

Table of Contents

  • General Information
  • Getting Started
  • Available Metrics
  • Disabling Metrics Collection

To provide more visibility into the Node.js runtime, the Node.js language metrics feature surfaces additional language-specific time series metrics within Application Metrics. Node.js metrics include Aggregate Time Spent in Garbage Collection, Aggregate Garbage Collections, Event Loop Latency, and Event Loop Usage.

This feature is currently in public beta. Please email heroku-metrics-feedback@salesforce.com to provide feedback.

Node.js language metrics are available for all dynos except for eco dynos.

General Information

For general information on metrics display settings, please refer to the language runtime metrics parent document.

Getting Started

First, enable the Language Metrics flag on your application. You can do this via the Dashboard or the CLI. To enable it through Dashboard, open the metrics preferences panel and turn on the both the Enhanced Language Metrics toggle and the Node Language Metrics toggle.

Language Metrics Toggle

Alternatively, to enable it through the Heroku CLI:

$ heroku labs:enable "runtime-heroku-metrics" -a "example-app"
$ heroku labs:enable "nodejs-language-metrics" -a "example-app"

Verify your version of Node.js

In order to use Node.js Metrics you must be running Node v10.0.0 or higher. You can find the version you are using on your local machine by running:

$ node --version
v10.13.0

If you install your own version of Node.js other than the version installed by Heroku’s Node Buildpack, Node.js Language Metrics will not function.

Redeploy

Once you have enabled the Enhanced Language Metrics feature re-deploy your application using an empty commit.

$ git commit --allow-empty -m "Enable Node.js Language Metrics"
$ git push heroku master

After a few minutes, you will begin receiving metrics which can be viewed via the Application Metrics tab.

Available Metrics

It may take a few minutes for these metrics to become available after the steps above are completed.

Aggregate Time Spent in Garbage Collection

This plot tracks the total pause time (when app execution is halted) to run garbage collection for each rollup across all dynos of the current process type. It also displays the percentage of the time during the rollup that was spent running the garbage collector. gcstop

Aggregate Garbage Collections

The number of GC collection, aggregated across all dynos, is displayed on this plot. gcagg

Event Loop Latency

At the heart of Node’s asynchronous model is the Event Loop. Your Node.js app is single-threaded and can only process one request at a time, but when it makes an asynchronous request, like a database query, it yields the thread back to the event loop. Event Loop Latency refers to the amount of time your code runs before yielding back to the event loop. High event loop latency can make it difficult to scale your application as traffic grows.

The latency of the event loop, aggregated across all dynos, and displayed as a median, 95th percentile, 99th percentile, and maximum latency, is displayed on this plot. Event Loop Latency Chart

Event Loop Usage

The percentage of time that the event loop is being blocked by work. A high percentage could indicate that your app is under a high load and may be under-provisioned.

The Event Loop Usage plot displays the minimum, maximum, and average of the observations taken during each rollup across all dynos of the current process type regarding the percentage usage of the event loop. Event Loop Usage Chart

Disabling Metrics Collection

To disable Node.js metrics collection, simply toggle off the Enhanced Language Metrics toggle via the Metrics Preferences panel, or using this CLI command:

$ heroku labs:disable "runtime-heroku-metrics" -a "example-app"

Keep reading

  • Monitoring & Metrics

Feedback

Log in to submit feedback.

The Heroku Dashboard Production Check

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences