Generally you should just let your addons scale with the user's UI scale, unless it has to be UI scale independent for a specific reason.
Example: if you have borders which are exactly 1 px in size, you'll want them to appear at exactly 1 px, meaning you have to counter the UI scale so they have an 'effective scale' (= actual scale taking the scale of every parent frame including the UIParent into account) of 1.
You'll want to use:
Code:
frame:SetScale(1 / UIParent:GetScale())
You need to wait to get the UI scale though until the VARIABLES_LOADED event has fired. Also, you'll want to register UI_SCALE_CHANGED in case the user or a different addon changes the UI scale later on.
So:
Code:
frame:RegisterEvent("VARIABLES_LOADED")
frame:RegisterEvent("UI_SCALE_CHANGED")
frame:SetScript("OnEvent", function(self)
self:SetScale(1 / UIParent:GetScale())
end)