java - Can you programmatically access current Heroku dyno id/name? -
on heroku, can programmatically, within app, kind of identifier dyno executing code? example dyno name (e.g. "web.1" or "worker.1"), or other id.
if yes, how in java?
there hostname of machine (which looks d.long_guid
. suppose (though haven't tried) should work:
string localhostname = java.net.inetaddress.getlocalhost().gethostname();
also, little known secret, can "web.1", "web.2" id's looking @ value of environment variable ps1
string hostid = system.getenv("ps1")
edit 2013-july-26
as per heroku changelog, local environment variable dyno
replaces ps
, replaced ps1
.
Comments
Post a Comment