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
      • Working with Bundler
      • Rails Support
    • Python
      • Background Jobs in Python
      • Working with Django
    • Java
      • Working with Maven
      • Java Database Operations
      • 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
  • Extending Heroku
  • Heroku Labs
  • Heroku Labs: Dyno Metadata

Heroku Labs: Dyno Metadata

English — 日本語に切り替える

Last updated March 09, 2020

Table of Contents

  • Usage
  • Removal

Dyno metadata gives the dyno easy access to information about the app and environment. Examples of available dyno metadata include details about the release, dyno size, application name as well as the unique identifier for the particular running dyno.

Dyno metadata can be used to:

  • Get release information: Knowing which git SHA of the release your dyno is running is useful for continuous integration, callbacks, and debugging.

  • Easily access the application name: Knowing your application name can make debugging easier when you are running multiple versions of the same application across regions.

Features added through Heroku Labs are experimental and subject to change.

Usage

Dyno processes are able to inspect metadata as config vars set in the dyno. For an app to get these variables, you must first enable the labs feature on the application.

You can enable this by running:

$ heroku labs:enable runtime-dyno-metadata -a <app name>

The metadata will be available the next time you deploy the app.

Dyno metadata

The following dyno metadata will be made available:

Name Description Example
HEROKU_APP_ID The unique identifier for the application. "9daa2797-e49b-4624-932f-ec3f9688e3da"
HEROKU_APP_NAME The application name. "example-app"
HEROKU_DYNO_ID The dyno identifier. This metadata is not yet available in Private Spaces nor the Container Registry. "1vac4117-c29f-4312-521e-ba4d8638c1ac"
HEROKU_RELEASE_CREATED_AT The time and date the release was created. "2015-04-02T18:00:42Z"
HEROKU_RELEASE_VERSION The identifier for the current release. "v42"
HEROKU_SLUG_COMMIT The commit hash for the current release. "2c3a0b24069af49b3de35b8e8c26765c1dba9ff0"
HEROKU_SLUG_DESCRIPTION The description of the current release. "Deploy 2c3a0b2"

In certain situations, such as pushing a tarball manually using the Releases API, the slug commit hash may be null.

 

It is not recommended that you set HEROKU_* environment variables on your application as it runs the risk of conflicting with these changes.

Example dyno metadata

$ env
HEROKU_APP_ID:                   9daa2797-e49b-4624-932f-ec3f9688e3da
HEROKU_APP_NAME:                 example-app
HEROKU_DYNO_ID:                  1vac4117-c29f-4312-521e-ba4d8638c1ac
HEROKU_RELEASE_CREATED_AT:       2015-04-02T18:00:42Z
HEROKU_RELEASE_VERSION:          v42
HEROKU_SLUG_COMMIT:              2c3a0b24069af49b3de35b8e8c26765c1dba9ff0
HEROKU_SLUG_DESCRIPTION:         Deploy 2c3a0b2
...

Removal

If you no longer wish to participate in this lab, please remove the lab from your app and then remove any config vars you may not want. Out of concern for removing config vars that your application may be depending upon, removal of the lab will not remove config vars at this time. As with all labs, this functionality is experimental and may change.

You can disable the continued updating of the config vars by opting out of the lab:

$ heroku labs:disable runtime-dyno-metadata -a <app name>

You can remove the config vars by unsetting any you wish to remove. Here we remove all config vars set by this feature:

$ heroku config:unset HEROKU_APP_ID HEROKU_APP_NAME HEROKU_DYNO_ID \
HEROKU_RELEASE_CREATED_AT HEROKU_RELEASE_VERSION HEROKU_SLUG_COMMIT \
HEROKU_SLUG_DESCRIPTION -a <app name>

Keep reading

  • Heroku Labs

Feedback

Log in to submit feedback.

Heroku Labs: log-runtime-metrics Heroku Labs: log-runtime-metrics

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