Hi, is it possible to, from the task code, get the...
# ask-the-community
t
Hi, is it possible to, from the task code, get the hostname of the executing pod?
f
The environment variable
$HOSTNAME
should contain it 🙂
Can you please try whether this works?
t
yes it works, thanks
os.environ.get(“HOSTNAME”) returns the hostname of the running task
k
We are thinking of adding this to debugging info in Ui, but not make it confusing
f
Maybe adding it to the execution context or smth like that? So in case that for example the env var is changed, nothing tied to that breaks
f
Adding that to the UI for each task would be nice, my collegues also asked for that
f
I always go to stackdriver logs and copy it from the query.
Could be quicker though if directly in console
101 Views