Skip to content

chore: increase max timeseries buckets - #7482

Merged
shruthilayaj merged 5 commits into
masterfrom
shruthi/chore/increase-rpc-max-buckets
Oct 29, 2025
Merged

shruthilayaj merged 5 commits into
masterfrom
shruthi/chore/increase-rpc-max-buckets

Conversation

@shruthilayaj

@shruthilayaj shruthilayaj commented Oct 27, 2025 •

Copy link
Copy Markdown
Member

We're migrating transaction alerts to spans. Transaction alerts supported 1 min intervals so we need to be able to plot a 1 week query with this interval (example). We don't intend to open this option up to new span alerts though. This is just to ensure old transaction alerts can be migrated to spans correctly.

@shruthilayaj
shruthilayaj marked this pull request as ready for review October 27, 2025 18:18
@shruthilayaj
shruthilayaj requested review from a team as code owners October 27, 2025 18:18
@codecov

codecov Bot commented Oct 27, 2025

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2811 1 2810 12
View the top 1 failed test(s) by shortest run time
tests.web.rpc.v1.test_endpoint_time_series.test_endpoint_time_series.TestUtils::test_bad_granularity[start_ts1-end_ts1-15]
Stack Traces | 0.021s run time
Traceback (most recent call last):
  File "/.venv/lib/python3.11........./site-packages/_pytest/runner.py", line 341, in from_call
    result: TResult | None = func()
                             ^^^^^^
  File "/.venv/lib/python3.11........./site-packages/_pytest/runner.py", line 242, in <lambda>
    lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11....../site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 182, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11.../site-packages/pluggy/_result.py", line 100, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 167, in _multicall
    teardown.throw(outcome._exception)
  File "/.venv/lib/python3.11....../site-packages/_pytest/threadexception.py", line 92, in pytest_runtest_call
    yield from thread_exception_runtest_hook()
  File "/.venv/lib/python3.11....../site-packages/_pytest/threadexception.py", line 68, in thread_exception_runtest_hook
    yield
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 167, in _multicall
    teardown.throw(outcome._exception)
  File "/.venv/lib/python3.11....../site-packages/_pytest/unraisableexception.py", line 95, in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
  File "/.venv/lib/python3.11....../site-packages/_pytest/unraisableexception.py", line 70, in unraisable_exception_runtest_hook
    yield
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 167, in _multicall
    teardown.throw(outcome._exception)
  File "/.venv/lib/python3.11....../site-packages/_pytest/logging.py", line 846, in pytest_runtest_call
    yield from self._runtest_for(item, "call")
  File "/.venv/lib/python3.11....../site-packages/_pytest/logging.py", line 829, in _runtest_for
    yield
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 167, in _multicall
    teardown.throw(outcome._exception)
  File "/.venv/lib/python3.11.../site-packages/_pytest/capture.py", line 880, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 167, in _multicall
    teardown.throw(outcome._exception)
  File "/.venv/lib/python3.11.../site-packages/_pytest/skipping.py", line 257, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11........./site-packages/_pytest/runner.py", line 174, in pytest_runtest_call
    item.runtest()
  File "/.venv/lib/python3.11....../site-packages/_pytest/python.py", line 1627, in runtest
    self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  File "/.venv/lib/python3.11....../site-packages/pluggy/_hooks.py", line 513, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11....../site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 139, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/.venv/lib/python3.11.........................../site-packages/pluggy/_callers.py", line 103, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.11....../site-packages/_pytest/python.py", line 159, in pytest_pyfunc_call
    result = testfunction(**testargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../v1/test_endpoint_time_series/test_endpoint_time_series.py", line 1882, in test_bad_granularity
    with pytest.raises(BadSnubaRPCRequestException):
  File "/.venv/lib/python3.11.../site-packages/_pytest/python_api.py", line 1011, in __exit__
    fail(self.message)
  File "/.venv/lib/python3.11.../site-packages/_pytest/outcomes.py", line 178, in fail
    raise Failed(msg=reason, pytrace=pytrace)
Failed: DID NOT RAISE <class 'snuba.web.rpc.common.exceptions.BadSnubaRPCRequestException'>

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

[
(BASE_TIME, BASE_TIME + timedelta(hours=1), 1),
(BASE_TIME, BASE_TIME + timedelta(hours=24), 15),
(BASE_TIME, BASE_TIME + timedelta(hours=24 * 3), 15),

@shruthilayaj shruthilayaj Oct 27, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only relevant change, rest is all auto-commit code

@shruthilayaj
shruthilayaj merged commit 2000a5f into master Oct 29, 2025
@shruthilayaj
shruthilayaj deleted the shruthi/chore/increase-rpc-max-buckets branch October 29, 2025 16:42
nikkikapadia added a commit that referenced this pull request Jan 15, 2026
We initially increased the max timeseries buckets in this PR:
#7482
But the number of buckets was still higher than this value and is
throwing errors on alerts/monitors like [this
one](https://sentry.sentry.io/monitors/2809118/?project=-1&statsPeriod=7d).
This was the error snuba was throwing:
https://sentry.sentry.io/issues/7084207705/?project=1&query=is%3Aunresolved%20user.email%3Awilliam.mak%40sentry.io&referrer=issue-stream

Seems like the quantizing the timeseries range is resulting in varying
bucket numbers. We're increasing the max buckets a little more to
account for any of these quantizing discrepancies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants