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
For Django to bootstrap and run and/or for traces and profiles sample rates to either both accept strings or both fail, either way they should be consistent it seems.
Actual Result
To adjust profile and sample rates on the fly we add them to a centralized store as strings. However,
this surfaced an inconsistency, setting profiles_sample_rate as a string causes Django to not bootstrap.
Output
File "/Users/jree/.pyenv/versions/3.11.4/envs/shepherd-3.11/lib/python3.11/site-packages/sentry_sdk/profiler/transaction_profiler.py", line 127, in has_profiling_enabled
if profiles_sample_rate is not None and profiles_sample_rate > 0:
^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'str' and 'int'
This only affects profiles_sample_rate, traces_sample_rate is not affected by this.
The text was updated successfully, but these errors were encountered:
@jreeterprofiles_sample_rate and traces_sample_rate are both typed as Optional[float]. Passing any other type, including str, is not supported. The SDK's behavior when passing an invalid type is undefined, meaning that it might work fine or it might not; it might error, or could fail silently; it could get stuck in an infinite loop, or your app could crash. In particular, we don't guarantee that passing invalid types will result in the same behavior for both traces_sample_rate and profiles_sample_rate.
tldr: the SDK is behaving as expected, from our end there is nothing to do here; please pass float values instead of str for both of these. If you are storing the values as strings, you need to convert them to float values before passing them to the SDK.
How do you use Sentry?
Sentry Saas (sentry.io)
Version
2.22.0
Steps to Reproduce
Set traces and profile rates to strings:
Expected Result
For Django to bootstrap and run and/or for traces and profiles sample rates to either both accept strings or both fail, either way they should be consistent it seems.
Actual Result
To adjust profile and sample rates on the fly we add them to a centralized store as strings. However,
this surfaced an inconsistency, setting profiles_sample_rate as a string causes Django to not bootstrap.
Output
This only affects
profiles_sample_rate
,traces_sample_rate
is not affected by this.The text was updated successfully, but these errors were encountered: