From 3ab587abe76aaab1e614b3341e860204bcb2b8bc Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Sat, 8 May 2021 07:40:45 -0700 Subject: [PATCH] hostinfo: detect Heroku Dyno. Signed-off-by: Denton Gentry --- control/controlclient/hostinfo_linux.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/control/controlclient/hostinfo_linux.go b/control/controlclient/hostinfo_linux.go index 364e1098b..187e0d36a 100644 --- a/control/controlclient/hostinfo_linux.go +++ b/control/controlclient/hostinfo_linux.go @@ -65,6 +65,9 @@ func osVersionLinux() string { if inAwsLambda() { attrBuf.WriteString("; env=lm") } + if inHerokuDyno() { + attrBuf.WriteString("; env=hr") + } attr := attrBuf.String() id := m["ID"] @@ -135,3 +138,10 @@ func inAwsLambda() bool { } return false } +func inHerokuDyno() bool { + // https://devcenter.heroku.com/articles/dynos#local-environment-variables + if os.Getenv("PORT") != "" && os.Getenv("DYNO") != "" { + return true + } + return false +}