hostinfo: detect Heroku Dyno.
@@ -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
+}
