Deep-dive on the Next Gen Platform. Join the Webinar!

Skip Navigation
Show nav
Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
    • .NET
  • 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
Hide categories

Categories

  • Heroku Architecture
    • Compute (Dynos)
      • Dyno Management
      • Dyno Concepts
      • Dyno Behavior
      • Dyno Reference
      • Dyno Troubleshooting
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Developer Tools
    • Command Line
    • Heroku VS Code Extension
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery & Integration (Heroku Flow)
    • Continuous Integration
  • Language Support
    • Node.js
      • Node.js Behavior in Heroku
      • Working with Node.js
      • Troubleshooting Node.js Apps
    • Ruby
      • Rails Support
      • Working with Bundler
      • Working with Ruby
      • Ruby Behavior in Heroku
      • Troubleshooting Ruby Apps
    • Python
      • Working with Python
      • Background Jobs in Python
      • Python Behavior in Heroku
      • Working with Django
    • Java
      • Java Behavior in Heroku
      • Working with Java
      • Working with Maven
      • Working with Spring Boot
      • Troubleshooting Java Apps
    • PHP
      • Working with PHP
      • PHP Behavior in Heroku
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
    • .NET
      • Working with .NET
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
      • Migrating to Heroku Postgres
    • Heroku Key-Value Store
    • Apache Kafka on Heroku
    • Other Data Stores
  • AI
    • Working with AI
    • Heroku Inference
      • AI Models
      • Inference Essentials
      • Inference API
      • Quick Start Guides
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
      • Single Sign-on (SSO)
    • Private Spaces
      • Infrastructure Networking
    • Compliance
  • Heroku Enterprise
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
  • 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 August 10, 2024

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.

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

 

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.

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"

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.

Working with Heroku Telemetry Drains OpenTelemetry Concepts and Heroku

Information & Support

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

Language Reference

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

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing
  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Github
  • LinkedIn
  • © 2025 Salesforce, Inc. All rights reserved. Various trademarks held by their respective owners. Salesforce Tower, 415 Mission Street, 3rd Floor, San Francisco, CA 94105, United States
  • heroku.com
  • Legal
  • Terms of Service
  • Privacy Information
  • Responsible Disclosure
  • Trust
  • Contact
  • Cookie Preferences
  • Your Privacy Choices