mirror of https://github.com/zulip/zulip.git
sentry: More gracefully handle a value of 0.
If the value at runtime is actually an int, not a float, we should not try to treat it as a dict.
This commit is contained in:
parent
959c78e1e1
commit
5f3d6ac983
|
@ -55,10 +55,10 @@ def traces_sampler(sampling_context: Dict[str, Any]) -> Union[float, bool]:
|
|||
|
||||
queue = sampling_context.get("queue")
|
||||
if queue is not None and isinstance(queue, str):
|
||||
if isinstance(settings.SENTRY_TRACE_WORKER_RATE, float):
|
||||
return settings.SENTRY_TRACE_WORKER_RATE
|
||||
else:
|
||||
if isinstance(settings.SENTRY_TRACE_WORKER_RATE, dict):
|
||||
return settings.SENTRY_TRACE_WORKER_RATE.get(queue, 0.0)
|
||||
else:
|
||||
return settings.SENTRY_TRACE_WORKER_RATE
|
||||
else:
|
||||
return settings.SENTRY_TRACE_RATE
|
||||
|
||||
|
|
Loading…
Reference in New Issue