Bug 1176412 - Override the hostname reported by New Relic on Heroku
Bug 1176412 - Override the hostname reported by New Relic on Heroku

On Heroku, the hostname is just a bunch of hex characters, which the New
Relic dashboard displays as "Dynamic Hostname". The New Relic Python
agent (as of v2.52.0.40) supports overriding this, by setting the
environment variable `NEW_RELIC_PROCESS_HOST_DISPLAY_NAME`:
https://docs.newrelic.com/docs/agents/python-agent/installation-configuration/python-agent-configuration#process_host-display_name

We use the value of `DYNO`, since this is set for us in each dyno's
environment, and is of form "web.2", "worker_pushlog.1" etc. Rather than
prefixing every line in the Procfile, we instead append the export to
the profile script created by the Python buildpack, so it's populated at
runtime on every dyno. See:
https://devcenter.heroku.com/articles/profiled

To do this we make use of the Python buildpack's `set-env` function:
https://github.com/heroku/heroku-buildpack-python/blob/ce3bdb37bafa3f56c54346d28ee5ef138cbc1893/bin/utils#L29-L32

Similar to what the buildpack does for its own env defines:
https://github.com/heroku/heroku-buildpack-python/blob/ce3bdb37bafa3f56c54346d28ee5ef138cbc1893/bin/compile#L190-L198

moijes12/treeherder,moijes12/treeherder,akhileshpillai/treeherder,tojon/treeherder,jgraham/treeherder,avih/treeherder,kapy2010/treeherder,wlach/treeherder,avih/treeherder,avih/treeherder,moijes12/treeherder,adusca/treeherder,tojonmz/treeherder,akhileshpillai/treeherder,adusca/treeherder,tojon/treeherder,parkouss/treeherder,gbrmachado/treeherder,tojonmz/treeherder,tojonmz/treeherder,parkouss/treeherder,moijes12/treeherder,rail/treeherder,sylvestre/treeherder,kapy2010/treeherder,jgraham/treeherder,edmorley/treeherder,tojon/treeherder,parkouss/treeherder,wlach/treeherder,rail/treeherder,wlach/treeherder,wlach/treeherder,glenn124f/treeherder,KWierso/treeherder,sylvestre/treeherder,gbrmachado/treeherder,edmorley/treeherder,moijes12/treeherder,avih/treeherder,KWierso/treeherder,tojon/treeherder,akhileshpillai/treeherder,glenn124f/treeherder,jgraham/treeherder,rail/treeherder,tojonmz/treeherder,rail/treeherder,rail/treeherder,kapy2010/treeherder,gbrmachado/treeherder,rail/treeherder,parkouss/treeherder,parkouss/treeherder,akhileshpillai/treeherder,adusca/treeherder,akhileshpillai/treeherder,deathping1994/treeherder,adusca/treeherder,sylvestre/treeherder,gbrmachado/treeherder,sylvestre/treeherder,KWierso/treeherder,deathping1994/treeherder,akhileshpillai/treeherder,KWierso/treeherder,glenn124f/treeherder,deathping1994/treeherder,deathping1994/treeherder,gbrmachado/treeherder,edmorley/treeherder,moijes12/treeherder,jgraham/treeherder,jgraham/treeherder,tojonmz/treeherder,sylvestre/treeherder,glenn124f/treeherder,adusca/treeherder,sylvestre/treeherder,avih/treeherder,glenn124f/treeherder,adusca/treeherder,edmorley/treeherder,wlach/treeherder,parkouss/treeherder,jgraham/treeherder,gbrmachado/treeherder,avih/treeherder,deathping1994/treeherder,glenn124f/treeherder,deathping1994/treeherder,wlach/treeherder,kapy2010/treeherder,kapy2010/treeherder,tojonmz/treeherder