Skip to content

ref(snuba): Use metrics.timer instead of bespoke timer helper#115279

Merged
mrduncan merged 5 commits into
masterfrom
mrduncan/ref/use-metrics-timer-in-snuba-utils
May 29, 2026
Merged

ref(snuba): Use metrics.timer instead of bespoke timer helper#115279
mrduncan merged 5 commits into
masterfrom
mrduncan/ref/use-metrics-timer-in-snuba-utils

Conversation

@mrduncan
Copy link
Copy Markdown
Member

@mrduncan mrduncan commented May 11, 2026

Replace the local timer context manager in sentry.utils.snuba with metrics.timer from sentry.utils.metrics so timing in this file matches the rest of the codebase. Metric names are preserved as snuba.client.<name>; each timing now also carries the standard result=success|failure tag emitted by metrics.timer.

The current value seems to be getting reported as unitless seconds: sentry / datadog

Replace the local timer context manager in sentry.utils.snuba with
metrics.timer from sentry.utils.metrics so timing in this file matches
the rest of the codebase. Metric names are preserved as
snuba.client.<name>; each timing now also carries the standard
result=success|failure tag emitted by metrics.timer.
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 11, 2026
mrduncan added a commit that referenced this pull request May 28, 2026
Replace the bespoke timer context manager with metrics.timer for the
get_snuba_map call site only, as a canary to confirm metric values are
unchanged before migrating the remaining call sites in #115279.

There are monitors on some of the other call sites in #115279 and I'd
like to not page anyone.
@github-actions
Copy link
Copy Markdown
Contributor

Backend Test Failures

Failures on 440b383 in this run:

tests/symbolicator/test_minidump_full.py::SymbolicatorMinidumpIntegrationTest::test_full_minidump_json_extralog
[gw0] linux -- Python 3.13.1 /home/runner/work/sentry/sentry/.venv/bin/python3
tests/symbolicator/test_minidump_full.py:124: in test_full_minidump_json_extra
    event = self.post_and_retrieve_minidump(
src/sentry/testutils/relay.py:127: in post_and_retrieve_minidump
    assert resp.ok
E   assert False
E    +  where False = <Response [503]>.ok

@mrduncan mrduncan marked this pull request as ready for review May 29, 2026 22:03
@mrduncan mrduncan requested review from a team as code owners May 29, 2026 22:03
@mrduncan mrduncan merged commit 7592d6b into master May 29, 2026
114 of 117 checks passed
@mrduncan mrduncan deleted the mrduncan/ref/use-metrics-timer-in-snuba-utils branch May 29, 2026 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants