Skip to content

Commit 7e46c18

Browse files
getsentry-botbeezz
andcommitted
Revert "ref: upgrade datadog to a typed version (#54758)"
This reverts commit 3bfe952. Co-authored-by: beezz <[email protected]>
1 parent 8d02d02 commit 7e46c18

File tree

7 files changed

+12
-23
lines changed

7 files changed

+12
-23
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ module = [
9696
"codeowners.*",
9797
"confluent_kafka.*",
9898
"cssselect.*",
99+
"datadog.*",
99100
"django_zero_downtime_migrations.backends.postgres.schema.*",
100101
"docker.*",
101102
"email_reply_parser.*",

requirements-base.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ click>=8.0.4
99
confluent-kafka>=2.1.1
1010
croniter>=1.3.10
1111
cssselect>=1.0.3
12-
datadog>=0.46.0
12+
datadog>=0.29.3
1313
django-crispy-forms>=1.14.0
1414
django-csp>=3.7
1515
django-pg-zero-downtime-migrations>=0.13

requirements-dev-frozen.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ croniter==1.3.10
3535
cryptography==39.0.1
3636
cssselect==1.0.3
3737
cssutils==2.4.0
38-
datadog==0.46.0
38+
datadog==0.29.3
39+
decorator==5.1.1
3940
dictpath==0.1.3
4041
distlib==0.3.4
4142
django==3.2.20

requirements-frozen.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ croniter==1.3.10
3030
cryptography==39.0.1
3131
cssselect==1.0.3
3232
cssutils==2.4.0
33-
datadog==0.46.0
33+
datadog==0.29.3
34+
decorator==5.1.1
3435
django==3.2.20
3536
django-crispy-forms==1.14.0
3637
django-csp==3.7

src/sentry/metrics/datadog.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
from typing import Any, Optional, Union
44

5-
from datadog import initialize
6-
from datadog.threadstats.base import ThreadStats
5+
from datadog import ThreadStats, initialize
76
from datadog.util.hostname import get_hostname
87

98
from sentry.utils.cache import memoize
@@ -18,7 +17,7 @@ def __init__(self, prefix: Optional[str] = None, **kwargs: Any) -> None:
1817
if "host" in kwargs:
1918
self.host = kwargs.pop("host")
2019
else:
21-
self.host = get_hostname(hostname_from_config=True)
20+
self.host = get_hostname()
2221
initialize(**kwargs)
2322
super().__init__(prefix=prefix)
2423

src/sentry/metrics/dogstatsd.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from typing import Any, Optional, Union
22

3-
from datadog import initialize
4-
from datadog.dogstatsd.base import statsd
3+
from datadog import initialize, statsd
54

65
from .base import MetricsBackend, Tags
76

tests/sentry/metrics/test_datadog.py

+3-15
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,19 @@ def setUp(self):
1414
def test_incr(self, mock_incr):
1515
self.backend.incr("foo", instance="bar")
1616
mock_incr.assert_called_once_with(
17-
"sentrytest.foo",
18-
1,
19-
sample_rate=1,
20-
tags=["instance:bar"],
21-
host=get_hostname(hostname_from_config=True),
17+
"sentrytest.foo", 1, sample_rate=1, tags=["instance:bar"], host=get_hostname()
2218
)
2319

2420
@patch("datadog.threadstats.base.ThreadStats.timing")
2521
def test_timing(self, mock_timing):
2622
self.backend.timing("foo", 30, instance="bar")
2723
mock_timing.assert_called_once_with(
28-
"sentrytest.foo",
29-
30,
30-
sample_rate=1,
31-
tags=["instance:bar"],
32-
host=get_hostname(hostname_from_config=True),
24+
"sentrytest.foo", 30, sample_rate=1, tags=["instance:bar"], host=get_hostname()
3325
)
3426

3527
@patch("datadog.threadstats.base.ThreadStats.gauge")
3628
def test_gauge(self, mock_gauge):
3729
self.backend.gauge("foo", 5, instance="bar")
3830
mock_gauge.assert_called_once_with(
39-
"sentrytest.foo",
40-
5,
41-
sample_rate=1,
42-
tags=["instance:bar"],
43-
host=get_hostname(hostname_from_config=True),
31+
"sentrytest.foo", 5, sample_rate=1, tags=["instance:bar"], host=get_hostname()
4432
)

0 commit comments

Comments
 (0)