diff --git a/hostinfo/hostinfo.go b/hostinfo/hostinfo.go index 58c8e9de3..794b383af 100644 --- a/hostinfo/hostinfo.go +++ b/hostinfo/hostinfo.go @@ -28,6 +28,7 @@ const ( Heroku = EnvType("hr") AzureAppService = EnvType("az") AWSFargate = EnvType("fg") + FlyDotIo = EnvType("fly") ) var envType atomic.Value // of EnvType @@ -57,6 +58,9 @@ func getEnvType() EnvType { if inAWSFargate() { return AWSFargate } + if inFlyDotIo() { + return FlyDotIo + } return "" } @@ -126,3 +130,10 @@ func inAWSFargate() bool { } return false } + +func inFlyDotIo() bool { + if os.Getenv("FLY_APP_NAME") != "" && os.Getenv("FLY_REGION") != "" { + return true + } + return false +}