Heroku Labs: Dyno Metadata
Last updated 01 August 2016
Table of Contents
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.
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.
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 ...
|HEROKU_APP_ID||The unique identifier for the application.||
|HEROKU_APP_NAME||The application name.||
|HEROKU_DYNO_ID||The dyno identifier.||
|HEROKU_RELEASE_CREATED_AT||The time and date the release was created.||
|HEROKU_RELEASE_VERSION||The identifier for the current release.||
|HEROKU_SLUG_COMMIT||The commit hash for the current release.||
|HEROKU_SLUG_DESCRIPTION||The description of the current release.||
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.