Skip to content

Commit 3670ef6

Browse files
antonpirkersl0thentr0pygetsantry[bot]
authored
Dogfood Python SDK 3.0.0a5 (#97664)
- Same as #96933 - Plus: Fix `continue_trace` for empty headers and `traces_samplers` so that we don't get extra transactions for taskworkers. - Plus: Move SDK logging config out of experimental. - Plus: Updated new `thread_leaks` tests to work with SDK 3.0 --------- Co-authored-by: Neel Shah <[email protected]> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent e7744fc commit 3670ef6

File tree

83 files changed

+337
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+337
-205
lines changed

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ dependencies = [
8383
"sentry-protos>=0.3.1",
8484
"sentry-redis-tools>=0.5.0",
8585
"sentry-relay>=0.9.11",
86-
"sentry-sdk[http2]>=2.29.1",
86+
"sentry-sdk[http2]==3.0.0a5",
8787
"sentry-usage-accountant>=0.0.10",
8888
# remove once there are no unmarked transitive dependencies on setuptools
8989
"setuptools>=70.0.0",
@@ -160,7 +160,7 @@ dev = [
160160
"pytest-fail-slow>=0.3.0",
161161
"pytest-json-report>=1.5.0",
162162
"pytest-rerunfailures>=15.0",
163-
"pytest-sentry>=0.3.0",
163+
"pytest-sentry==0.5.1",
164164
"pytest-workaround-12888>=1.0.0",
165165
"pytest-xdist>=3.0.2",
166166
"pyupgrade>=3.19.1",

requirements-base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ sentry-ophio>=1.1.3
6969
sentry-protos==0.3.1
7070
sentry-redis-tools>=0.5.0
7171
sentry-relay>=0.9.11
72-
sentry-sdk[http2]>=2.29.1
72+
sentry-sdk[http2]==3.0.0a5
7373
slack-sdk>=3.27.2
7474
snuba-sdk>=3.0.43
7575
simplejson>=3.17.6

requirements-dev-frozen.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ httpx==0.25.2
8383
hyperframe==6.1.0
8484
identify==2.6.1
8585
idna==3.7
86+
importlib-metadata==8.7.0
8687
inflection==0.5.1
8788
iniconfig==1.1.1
8889
iso3166==2.1.1
@@ -115,6 +116,9 @@ openapi-core==0.18.2
115116
openapi-pydantic==0.4.0
116117
openapi-schema-validator==0.6.2
117118
openapi-spec-validator==0.7.1
119+
opentelemetry-api==1.35.0
120+
opentelemetry-sdk==1.35.0
121+
opentelemetry-semantic-conventions==0.56b0
118122
orjson==3.10.10
119123
outcome==1.2.0
120124
packaging==24.1
@@ -152,7 +156,7 @@ pytest-fail-slow==0.3.0
152156
pytest-json-report==1.5.0
153157
pytest-metadata==3.1.1
154158
pytest-rerunfailures==15.0
155-
pytest-sentry==0.3.0
159+
pytest-sentry==0.5.1
156160
pytest-workaround-12888==1.0.0
157161
pytest-xdist==3.0.2
158162
python-dateutil==2.9.0.post0
@@ -191,7 +195,7 @@ sentry-ophio==1.1.3
191195
sentry-protos==0.3.1
192196
sentry-redis-tools==0.5.0
193197
sentry-relay==0.9.11
194-
sentry-sdk==2.29.1
198+
sentry-sdk==3.0.0a5
195199
sentry-usage-accountant==0.0.10
196200
simplejson==3.17.6
197201
six==1.17.0
@@ -248,6 +252,7 @@ wheel==0.38.4
248252
wrapt==1.17.0
249253
wsproto==1.1.0
250254
xmlsec==1.3.14
255+
zipp==3.23.0
251256
zstandard==0.18.0
252257

253258
# The following packages are considered to be unsafe in a requirements file:

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pytest-django>=4.9.0
1717
pytest-fail-slow>=0.3.0
1818
pytest-json-report>=1.5.0
1919
pytest-rerunfailures>=15
20-
pytest-sentry>=0.3.0,<0.4.0
20+
pytest-sentry>=0.5.1
2121
pytest-workaround-12888
2222
pytest-xdist>=3
2323
responses>=0.23.1

requirements-frozen.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ httpcore==1.0.9
6767
httpx==0.25.2
6868
hyperframe==6.1.0
6969
idna==3.7
70+
importlib-metadata==8.7.0
7071
inflection==0.5.1
7172
iso3166==2.1.1
7273
isodate==0.6.1
@@ -82,6 +83,9 @@ mmh3==4.0.0
8283
msgpack==1.1.0
8384
oauthlib==3.1.0
8485
openai==1.3.5
86+
opentelemetry-api==1.35.0
87+
opentelemetry-sdk==1.35.0
88+
opentelemetry-semantic-conventions==0.56b0
8589
orjson==3.10.10
8690
packaging==24.1
8791
parsimonious==0.10.0
@@ -128,7 +132,7 @@ sentry-ophio==1.1.3
128132
sentry-protos==0.3.1
129133
sentry-redis-tools==0.5.0
130134
sentry-relay==0.9.11
131-
sentry-sdk==2.29.1
135+
sentry-sdk==3.0.0a5
132136
sentry-usage-accountant==0.0.10
133137
simplejson==3.17.6
134138
six==1.17.0
@@ -155,6 +159,7 @@ vine==5.1.0
155159
vroomrs==0.1.17
156160
wcwidth==0.2.13
157161
xmlsec==1.3.14
162+
zipp==3.23.0
158163
zstandard==0.18.0
159164

160165
# The following packages are considered to be unsafe in a requirements file:

src/sentry/api/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,9 @@ def dispatch(self, request: Request, *args, **kwargs) -> Response:
447447
op="base.dispatch.sleep",
448448
name=type(self).__name__,
449449
) as span:
450-
span.set_data("SENTRY_API_RESPONSE_DELAY", settings.SENTRY_API_RESPONSE_DELAY)
450+
span.set_attribute(
451+
"SENTRY_API_RESPONSE_DELAY", settings.SENTRY_API_RESPONSE_DELAY
452+
)
451453
time.sleep(settings.SENTRY_API_RESPONSE_DELAY / 1000.0 - duration)
452454

453455
# Only enforced in dev environment

src/sentry/api/bases/organization.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def get_projects(
408408

409409
with sentry_sdk.start_span(op="fetch_organization_projects") as span:
410410
projects = list(qs)
411-
span.set_data("Project Count", len(projects))
411+
span.set_attribute("Project Count", len(projects))
412412

413413
filter_by_membership = not bool(ids) and not bool(slugs)
414414
filtered_projects = self._filter_projects_by_permissions(
@@ -434,7 +434,7 @@ def _filter_projects_by_permissions(
434434
include_all_accessible: bool = False,
435435
) -> list[Project]:
436436
with sentry_sdk.start_span(op="apply_project_permissions") as span:
437-
span.set_data("Project Count", len(projects))
437+
span.set_attribute("Project Count", len(projects))
438438
if force_global_perms:
439439
span.set_tag("mode", "force_global_perms")
440440
return projects

src/sentry/api/endpoints/organization_events_facets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def data_fn(offset, limit):
5757
)
5858

5959
with sentry_sdk.start_span(op="discover.endpoint", name="populate_results") as span:
60-
span.set_data("facet_count", len(facets or []))
60+
span.set_attribute("facet_count", len(facets or []))
6161
resp: dict[str, _KeyTopValues]
6262
resp = defaultdict(lambda: {"key": "", "topValues": []})
6363
for row in facets:

src/sentry/api/endpoints/organization_events_facets_performance.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def query_tag_data(
263263
Returns None if query was not successful which causes the endpoint to return early
264264
"""
265265
with sentry_sdk.start_span(op="discover.discover", name="facets.filter_transform") as span:
266-
span.set_data("query", filter_query)
266+
span.set_attribute("query", filter_query)
267267
tag_query = DiscoverQueryBuilder(
268268
dataset=Dataset.Discover,
269269
params={},
@@ -392,7 +392,7 @@ def query_facet_performance(
392392
tag_key_limit = limit if tag_key else 1
393393

394394
with sentry_sdk.start_span(op="discover.discover", name="facets.filter_transform") as span:
395-
span.set_data("query", filter_query)
395+
span.set_attribute("query", filter_query)
396396
tag_query = DiscoverQueryBuilder(
397397
dataset=Dataset.Discover,
398398
params={},
@@ -418,8 +418,8 @@ def query_facet_performance(
418418
)
419419

420420
with sentry_sdk.start_span(op="discover.discover", name="facets.aggregate_tags"):
421-
span.set_data("sample_rate", sample_rate)
422-
span.set_data("target_sample", target_sample)
421+
span.set_attribute("sample_rate", sample_rate)
422+
span.set_attribute("target_sample", target_sample)
423423
aggregate_comparison = transaction_aggregate * 1.005 if transaction_aggregate else 0
424424
aggregate_column = Function("avg", [translated_aggregate_column], "aggregate")
425425
tag_query.where.append(excluded_tags)

src/sentry/api/endpoints/organization_events_meta.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def get(self, request: Request, organization: Organization) -> Response:
171171

172172
with sentry_sdk.start_span(op="discover.endpoint", name="serialize_results") as span:
173173
results = list(results_cursor)
174-
span.set_data("result_length", len(results))
174+
span.set_attribute("result_length", len(results))
175175
context = serialize(
176176
results,
177177
request.user,

0 commit comments

Comments
 (0)