feat(dynamic-sampling): add sliding window calculation to per-org#116083
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit dfbd894. Configure here.
| except ObjectDoesNotExist as exc: | ||
| raise DynamicSamplingException(DynamicSamplingStatus.NO_SUBSCRIPTION) from exc | ||
| self.projects = self._get_projects() | ||
| self.sliding_window_sample_rate = self._get_sliding_window_sample_rate() |
There was a problem hiding this comment.
Unnecessary EAP query when blended sample rate is None
Low Severity
_get_sliding_window_sample_rate() executes a 24-hour EAP query unconditionally during __init__, even when self.sample_rate is None. Since is_enabled only checks self.sample_rate, a None value causes get_configuration() to discard the entire configuration object and return NoDynamicSamplingConfiguration(). The sliding window query result is never used in that path, making it wasted work for every org in the rollout that lacks a blended sample rate.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit dfbd894. Configure here.


Contributes to TET-2233