You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we SDK behaviour differs (slightly) if we in higher level SDKs or users in general pass undefined to certain SDK init options instead of not setting them at all.
tracesSampleRate: undefined makes the hasTracingEnabled return true, while not setting it (assuming no other tracing options are set) makes hasTracingEnabled return false.
Ideally, we just call dropUndefinedKeys on the user-passed options and move on. However, for this to work we need to change the implementation of hasTracingEnabled to not differentiate between the two possibilities. Also this questions the validity of hasTracingEnabled entirely because even if no sample rates are set at all, "Tracing without Performance" should be enabled.
The text was updated successfully, but these errors were encountered:
lforst
changed the title
Passing undefined to SDK init options should behave like not setting the options
[v9] Passing undefined to SDK init options should behave like not setting the options
Nov 13, 2024
Uh oh!
There was an error while loading. Please reload this page.
Description
Currently, we SDK behaviour differs (slightly) if we in higher level SDKs or users in general pass
undefined
to certain SDK init options instead of not setting them at all.Examples:
defaultIntegrations: undefined
causes no default integrations to be installed while not settingdefaultIntegrations
means default integrations get installed - fixed in fix(browser): Initialize default integration ifdefaultIntegrations: undefined
#13261tracesSampleRate: undefined
makes thehasTracingEnabled
returntrue
, while not setting it (assuming no other tracing options are set) makeshasTracingEnabled
returnfalse
.Ideally, we just call
dropUndefinedKeys
on the user-passed options and move on. However, for this to work we need to change the implementation ofhasTracingEnabled
to not differentiate between the two possibilities. Also this questions the validity ofhasTracingEnabled
entirely because even if no sample rates are set at all, "Tracing without Performance" should be enabled.The text was updated successfully, but these errors were encountered: