Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ dependencies = [
"sentry-protos>=0.4.2",
"sentry-redis-tools>=0.5.0",
"sentry-relay>=0.9.17",
"sentry-sdk[http2]>=2.42.0",
"sentry-sdk[http2]>=2.43.0",
"sentry-usage-accountant>=0.0.10",
# remove once there are no unmarked transitive dependencies on setuptools
"setuptools>=70.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/sentry/metrics/sentry_sdk.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from random import random
from typing import Any

from sentry_sdk import _metrics as metrics
from sentry_sdk import metrics

from .base import MetricsBackend, Tags

Expand Down
4 changes: 2 additions & 2 deletions tests/sentry/metrics/test_dualwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_dualwrite_distribution(distribution, timing):
distribution.assert_not_called()


@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
@mock.patch("datadog.dogstatsd.base.DogStatsd.increment")
@thread_leak_allowlist(reason="datadog dualwrite metrics", issue=98803)
def test_dualwrite_experimental_backend(dogstatsd_incr, sentry_sdk_incr):
Expand All @@ -57,7 +57,7 @@ def test_dualwrite_experimental_backend(dogstatsd_incr, sentry_sdk_incr):
sentry_sdk_incr.assert_not_called()


@mock.patch("sentry_sdk._metrics.gauge")
@mock.patch("sentry_sdk.metrics.gauge")
@mock.patch("datadog.dogstatsd.base.DogStatsd.gauge")
@thread_leak_allowlist(reason="datadog dualwrite metrics", issue=98803)
def test_dualwrite_experimental_backend_rollout_disabled(dogstatsd_gauge, sentry_sdk_gauge):
Expand Down
14 changes: 7 additions & 7 deletions tests/sentry/metrics/test_sentry_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TestSentrySDKMetricsBackend:
def backend(self):
return SentrySDKMetricsBackend(prefix="test.", experimental_sample_rate=1.0)

@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
def test_incr(self, mock_count, backend):
with mock.patch.object(backend, "_should_send", return_value=True):
backend.incr("foo", tags={"x": "y"}, amount=2, unit="count")
Expand All @@ -22,7 +22,7 @@ def test_incr(self, mock_count, backend):
attributes={"x": "y"},
)

@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
def test_incr_no_unit(self, mock_count, backend):
with mock.patch.object(backend, "_should_send", return_value=True):
backend.incr("foo", tags={"x": "y"}, amount=2)
Expand All @@ -34,7 +34,7 @@ def test_incr_no_unit(self, mock_count, backend):
attributes={"x": "y"},
)

@mock.patch("sentry_sdk._metrics.gauge")
@mock.patch("sentry_sdk.metrics.gauge")
def test_gauge(self, mock_gauge, backend):
with mock.patch.object(backend, "_should_send", return_value=True):
backend.gauge("bar", value=42.0, tags={"x": "y"}, unit="bytes")
Expand All @@ -46,7 +46,7 @@ def test_gauge(self, mock_gauge, backend):
attributes={"x": "y"},
)

@mock.patch("sentry_sdk._metrics.distribution")
@mock.patch("sentry_sdk.metrics.distribution")
def test_distribution(self, mock_distribution, backend):
with mock.patch.object(backend, "_should_send", return_value=True):
backend.distribution("baz", value=100.0, tags={"x": "y"}, unit="millisecond")
Expand All @@ -58,7 +58,7 @@ def test_distribution(self, mock_distribution, backend):
attributes={"x": "y"},
)

@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
def test_incr_with_instance(self, mock_count, backend):
with mock.patch.object(backend, "_should_send", return_value=True):
backend.incr("foo", instance="web", tags={"x": "y"}, amount=1)
Expand All @@ -76,13 +76,13 @@ def test_timing_noop(self, backend):
def test_event_noop(self, backend):
backend.event("title", "message")

@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
def test_incr_sampling(self, mock_count):
backend = SentrySDKMetricsBackend(prefix="test.", experimental_sample_rate=0.0)
backend.incr("foo", amount=1)
mock_count.assert_not_called()

@mock.patch("sentry_sdk._metrics.count")
@mock.patch("sentry_sdk.metrics.count")
def test_incr_deny_list(self, mock_count):
backend = SentrySDKMetricsBackend(
prefix="test.", experimental_sample_rate=1.0, deny_list=["test.denied"]
Expand Down
6 changes: 3 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading