sentry-sdk 2.41.0__py2.py3-none-any.whl → 2.42.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sentry-sdk might be problematic. Click here for more details.

@@ -218,33 +218,11 @@ def _should_be_included(
218
218
  )
219
219
 
220
220
 
221
- def add_query_source(span):
222
- # type: (sentry_sdk.tracing.Span) -> None
221
+ def add_source(span, project_root, in_app_include, in_app_exclude):
222
+ # type: (sentry_sdk.tracing.Span, Optional[str], Optional[list[str]], Optional[list[str]]) -> None
223
223
  """
224
224
  Adds OTel compatible source code information to the span
225
225
  """
226
- client = sentry_sdk.get_client()
227
- if not client.is_active():
228
- return
229
-
230
- if span.timestamp is None or span.start_timestamp is None:
231
- return
232
-
233
- should_add_query_source = client.options.get("enable_db_query_source", True)
234
- if not should_add_query_source:
235
- return
236
-
237
- duration = span.timestamp - span.start_timestamp
238
- threshold = client.options.get("db_query_source_threshold_ms", 0)
239
- slow_query = duration / timedelta(milliseconds=1) > threshold
240
-
241
- if not slow_query:
242
- return
243
-
244
- project_root = client.options["project_root"]
245
- in_app_include = client.options.get("in_app_include")
246
- in_app_exclude = client.options.get("in_app_exclude")
247
-
248
226
  # Find the correct frame
249
227
  frame = sys._getframe() # type: Union[FrameType, None]
250
228
  while frame is not None:
@@ -309,6 +287,68 @@ def add_query_source(span):
309
287
  span.set_data(SPANDATA.CODE_FUNCTION, frame.f_code.co_name)
310
288
 
311
289
 
290
+ def add_query_source(span):
291
+ # type: (sentry_sdk.tracing.Span) -> None
292
+ """
293
+ Adds OTel compatible source code information to a database query span
294
+ """
295
+ client = sentry_sdk.get_client()
296
+ if not client.is_active():
297
+ return
298
+
299
+ if span.timestamp is None or span.start_timestamp is None:
300
+ return
301
+
302
+ should_add_query_source = client.options.get("enable_db_query_source", True)
303
+ if not should_add_query_source:
304
+ return
305
+
306
+ duration = span.timestamp - span.start_timestamp
307
+ threshold = client.options.get("db_query_source_threshold_ms", 0)
308
+ slow_query = duration / timedelta(milliseconds=1) > threshold
309
+
310
+ if not slow_query:
311
+ return
312
+
313
+ add_source(
314
+ span=span,
315
+ project_root=client.options["project_root"],
316
+ in_app_include=client.options.get("in_app_include"),
317
+ in_app_exclude=client.options.get("in_app_exclude"),
318
+ )
319
+
320
+
321
+ def add_http_request_source(span):
322
+ # type: (sentry_sdk.tracing.Span) -> None
323
+ """
324
+ Adds OTel compatible source code information to a span for an outgoing HTTP request
325
+ """
326
+ client = sentry_sdk.get_client()
327
+ if not client.is_active():
328
+ return
329
+
330
+ if span.timestamp is None or span.start_timestamp is None:
331
+ return
332
+
333
+ should_add_request_source = client.options.get("enable_http_request_source", False)
334
+ if not should_add_request_source:
335
+ return
336
+
337
+ duration = span.timestamp - span.start_timestamp
338
+ threshold = client.options.get("http_request_source_threshold_ms", 0)
339
+ slow_query = duration / timedelta(milliseconds=1) > threshold
340
+
341
+ if not slow_query:
342
+ return
343
+
344
+ add_source(
345
+ span=span,
346
+ project_root=client.options["project_root"],
347
+ in_app_include=client.options.get("in_app_include"),
348
+ in_app_exclude=client.options.get("in_app_exclude"),
349
+ )
350
+
351
+
312
352
  def extract_sentrytrace_data(header):
313
353
  # type: (Optional[str]) -> Optional[Dict[str, Union[str, bool, None]]]
314
354
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry-sdk
3
- Version: 2.41.0
3
+ Version: 2.42.0
4
4
  Summary: Python client for Sentry (https://sentry.io)
5
5
  Home-page: https://github.com/getsentry/sentry-python
6
6
  Author: Sentry Team and Contributors
@@ -118,6 +118,8 @@ Provides-Extra: tornado
118
118
  Requires-Dist: tornado>=6; extra == "tornado"
119
119
  Provides-Extra: unleash
120
120
  Requires-Dist: UnleashClient>=6.0.1; extra == "unleash"
121
+ Provides-Extra: google-genai
122
+ Requires-Dist: google-genai>=1.29.0; extra == "google-genai"
121
123
  Dynamic: author
122
124
  Dynamic: author-email
123
125
  Dynamic: classifier
@@ -11,7 +11,7 @@ sentry_sdk/_werkzeug.py,sha256=m3GPf-jHd8v3eVOfBHaKw5f0uHoLkXrSO1EcY-8EisY,3734
11
11
  sentry_sdk/api.py,sha256=OkwQ2tA5YASJ77wLOteUdv_woPF4wL_JTOAMxe9z8k4,15282
12
12
  sentry_sdk/attachments.py,sha256=0Dylhm065O6hNFjB40fWCd5Hg4qWSXndmi1TPWglZkI,3109
13
13
  sentry_sdk/client.py,sha256=ilR4V9_m7tknWlMK9Czq9lHn7ccuU7lfu6B4l_oRTFk,40520
14
- sentry_sdk/consts.py,sha256=4buYhBmsKLTstqWizghIrHUFmKwo3PikaBP75mic_8w,50559
14
+ sentry_sdk/consts.py,sha256=q1vCuHWbIGLWmwemLk6cVXqM4WZFnKOGRNfvY2IXE2g,51058
15
15
  sentry_sdk/debug.py,sha256=ddBehQlAuQC1sg1XO-N4N3diZ0x0iT5RWJwFdrtcsjw,1019
16
16
  sentry_sdk/envelope.py,sha256=1nqp_DMw66MYtrszRiiCuodyi3JKcOiQodEMkD6uZ_c,10473
17
17
  sentry_sdk/feature_flags.py,sha256=savtmWAHjAvgw2m_KWW8mUagjLhAXCm3jjscmBlfIJ4,2232
@@ -26,7 +26,7 @@ sentry_sdk/session.py,sha256=BXWHf5Opg9yx7jKe-_iHxF6LDJw9Jnu7NfHxo3UQRpw,5589
26
26
  sentry_sdk/sessions.py,sha256=e7Jv8McW3QZp3H1GuI_CA_ezq_G0ZWY6nK0ZLqJRdNI,9172
27
27
  sentry_sdk/spotlight.py,sha256=93kdd8KxdLfcPaxFnFuqHgYAAL4FCfpK1hiiPoD7Ac4,8678
28
28
  sentry_sdk/tracing.py,sha256=lJG5TmA7mz7-RfJEr34ydgBf-lebRegejHkhdNsHH08,51747
29
- sentry_sdk/tracing_utils.py,sha256=XXdU_YH0Shuk2pkeUGZrZgi_CTQFuf42Plgu4qQq978,39288
29
+ sentry_sdk/tracing_utils.py,sha256=Qq4zPU1wEudCgQyb0nnS4AaTBmCchz6ovghGZEjc91w,40541
30
30
  sentry_sdk/transport.py,sha256=NzlBS5liRSh0Fm7Zi7sPdZG82uECw9myECs_JrClqkg,31878
31
31
  sentry_sdk/types.py,sha256=A92AqvfrGQZ9KY6FaUjKfL9F1HK7Ui3heQilVzfzYCs,1269
32
32
  sentry_sdk/utils.py,sha256=ytlUxHsGpnUQgnFBmDoEiFLq0iZ3cxJbPQi88HMniiA,62176
@@ -38,10 +38,10 @@ sentry_sdk/crons/__init__.py,sha256=3Zt6g1-pZZ12uRKKsC8QLm3XgJ4K1VYxgVpNNUygOZY,
38
38
  sentry_sdk/crons/api.py,sha256=mk-UB8Im2LU2rJFdE-TV302EaKnf8kAjwEL0bIV0Hzc,1767
39
39
  sentry_sdk/crons/consts.py,sha256=dXqJk5meBSu5rjlGpqAOlkpACnuUi7svQnAFoy1ZNUU,87
40
40
  sentry_sdk/crons/decorator.py,sha256=UrjeIqBCbvsuKrfjGkKJbbLBvjw2TQvDWcTO7WwAmrI,3913
41
- sentry_sdk/integrations/__init__.py,sha256=qtU1pBq6CEeAKPikc9cfARULouHYkl8jbXJpmZi-JUg,10394
41
+ sentry_sdk/integrations/__init__.py,sha256=c-0q-kzVEKt_2-bk2X4f4LLXnykTmldcjo98dEQmPms,10442
42
42
  sentry_sdk/integrations/_asgi_common.py,sha256=Ypg7IctB3iPPY60ebVlzChzgT8GeGpZ0YH8VvJNDlEY,3187
43
43
  sentry_sdk/integrations/_wsgi_common.py,sha256=A1-X7l1pZCcrbUhRHkmdKiK_EemEZjn7xToJIvlEuFM,7558
44
- sentry_sdk/integrations/aiohttp.py,sha256=_rfDKx1arvVQwcC20vh7HG80p8XtgzqKB3iBuPYZy8A,12895
44
+ sentry_sdk/integrations/aiohttp.py,sha256=FynazdaPWCanC91KKVba8yl0UwWnVJcJxWNPzSu64x0,13007
45
45
  sentry_sdk/integrations/anthropic.py,sha256=AeGNc8WGXhqtSk9oZcxcEAp1lRvQT16i6HOKUGfat2M,13935
46
46
  sentry_sdk/integrations/argv.py,sha256=GIY7TBFETF8Z0fDzqTXEJldt5XXCDdFNZxpGxP7EPaU,911
47
47
  sentry_sdk/integrations/ariadne.py,sha256=C-zKlOrU7jvTWmQHZx0M0tAZNkPPo7Z5-5jXDD92LiU,5834
@@ -69,7 +69,7 @@ sentry_sdk/integrations/gcp.py,sha256=u1rSi3nK2ISUQqkRnmKFG23Ks-SefshTf5PV0Dwp3_
69
69
  sentry_sdk/integrations/gnu_backtrace.py,sha256=FL7WkRfHT6idYCSLIrtFQ2G5ZTGoYudCKvBcjR5hqsI,2812
70
70
  sentry_sdk/integrations/gql.py,sha256=lN5LJNZwUHs_1BQcIrR0adIkgb9YiOh6UtoUG8vCO_Y,4801
71
71
  sentry_sdk/integrations/graphene.py,sha256=I6ZJ8Apd9dO9XPVvZY7I46-v1eXOW1C1rAkWwasF3gU,5042
72
- sentry_sdk/integrations/httpx.py,sha256=WwUulqzBLoGGqWUUdQg_MThwQUKzBXnA-m3g_1GOpCE,5866
72
+ sentry_sdk/integrations/httpx.py,sha256=HK0Nbxc4TAFesTz6gegz6tAHcIXKlOckFWrBHMBB0VM,6086
73
73
  sentry_sdk/integrations/huey.py,sha256=wlyxjeWqqJp1X5S3neD5FiZjXcyznm1dl8_u1wIo76U,5443
74
74
  sentry_sdk/integrations/huggingface_hub.py,sha256=B5z0--bC2tEDtWl5V7xAqM4234yhY_RYbnkZGgqC8PA,14952
75
75
  sentry_sdk/integrations/langchain.py,sha256=WeqF7F0HZKR8Fra4RAivgxtxt8BsgMxua6r4n-sLX84,30302
@@ -86,7 +86,7 @@ sentry_sdk/integrations/pure_eval.py,sha256=R2UuFCtQ_ShTIZJKPn9RUD06lbc6mug4Mv8S
86
86
  sentry_sdk/integrations/pymongo.py,sha256=cPpMGEbXHlV6HTHgmIDL1F-x3w7ZMROXVb4eUhLs3bw,6380
87
87
  sentry_sdk/integrations/pyramid.py,sha256=IDonzoZvLrH18JL-i_Qpbztc4T3iZNQhWFFv6SAXac8,7364
88
88
  sentry_sdk/integrations/quart.py,sha256=7h4BuGNWzZabVIIOKm194gMKDlIvS-dmWFW4iZXsmF4,7413
89
- sentry_sdk/integrations/ray.py,sha256=HfRxAfTYe9Mli3c8hv-HPD8XSZ339l-6yM-rKrCm2Os,4596
89
+ sentry_sdk/integrations/ray.py,sha256=gzyjDqc9THINu0R5FCYa-f8YPA5cS6XE0JFR-G5RwpQ,5323
90
90
  sentry_sdk/integrations/rq.py,sha256=2Cidur0yL_JtdpOtBup6D6aYyN4T9mgshebEc-kvp-E,5307
91
91
  sentry_sdk/integrations/rust_tracing.py,sha256=fQ0eG09w3IPZe8ecgeUoQTPoGFThkkarUyGC8KJj35o,9078
92
92
  sentry_sdk/integrations/sanic.py,sha256=Z7orxkX9YhU9YSX4Oidsi3n46J0qlVG7Ajog-fnUreo,12960
@@ -96,7 +96,7 @@ sentry_sdk/integrations/sqlalchemy.py,sha256=rzOK3yFLrRE3V7q-wVcAUhq5iSTrqGPW5yt
96
96
  sentry_sdk/integrations/starlette.py,sha256=oHuzJXRWnCgD22Q9_JHfuD2OSW7gIt_wwA-TTwJ_2ng,26235
97
97
  sentry_sdk/integrations/starlite.py,sha256=hSiVB6KZr8pxsQVRSGGP-9UQBLsBl-3DmrK_5CPebB8,10559
98
98
  sentry_sdk/integrations/statsig.py,sha256=-e57hxHfHo1S13YQKObV65q_UvREyxbR56fnf7bkC9o,1227
99
- sentry_sdk/integrations/stdlib.py,sha256=vgB9weDGh455vBwmUSgcQRgzViKstu3O0syOthCn_H0,8831
99
+ sentry_sdk/integrations/stdlib.py,sha256=4EeLQeU3yjPyjPORX6K0B5N8D5ZXT3eDAFIwjDckUj8,8968
100
100
  sentry_sdk/integrations/strawberry.py,sha256=u7Lk4u3sNEycdSmY1nQBzYKmqI-mO8BWKAAJkCSuTRA,14126
101
101
  sentry_sdk/integrations/sys_exit.py,sha256=AwShgGBWPdiY25aOWDLRAs2RBUKm5T3CrL-Q-zAk0l4,2493
102
102
  sentry_sdk/integrations/threading.py,sha256=0lNxcMLN7Z5DwLg9d1Of7lgGcMOggsM76bU35hIOGXA,7109
@@ -117,6 +117,10 @@ sentry_sdk/integrations/django/signals_handlers.py,sha256=iudWetTlzNr5-kx_ew1YwW
117
117
  sentry_sdk/integrations/django/templates.py,sha256=k3PQrNICGS4wqmFxK3o8KwOlqip7rSIryyc4oa1Wexc,5725
118
118
  sentry_sdk/integrations/django/transactions.py,sha256=Axyh3l4UvM96R3go2anVhew3JbrEZ4FSYd1r3UXEcw4,4951
119
119
  sentry_sdk/integrations/django/views.py,sha256=bjHwt6TVfYY7yfGUa2Rat9yowkUbQ2bYCcJaXJxP2Ik,3137
120
+ sentry_sdk/integrations/google_genai/__init__.py,sha256=BeE4uK8CjwU1qC3_CDEahSVZNpxMDu78o2IjUCbNDIQ,11208
121
+ sentry_sdk/integrations/google_genai/consts.py,sha256=nqHKKSyGixrSoozA06BGVBFaUCsvZlvGoubUZGI1kB8,559
122
+ sentry_sdk/integrations/google_genai/streaming.py,sha256=cRRbVD2Xv3ncoS2ICYhoPGVpHaOK_HHjXhCIij9Kos0,5191
123
+ sentry_sdk/integrations/google_genai/utils.py,sha256=6CB4DI0qXjyH2QXnzss19DhAv4HSc9fpS5d-63MWskk,19679
120
124
  sentry_sdk/integrations/grpc/__init__.py,sha256=zukyRYtaxRGcDuQSXBbVcpa7ZMAYdLQ-laRQqqHsHgc,5620
121
125
  sentry_sdk/integrations/grpc/client.py,sha256=4MCY24tqZAU6OzNC_0pphyCLnR_SrfBC-xh8Kb-i8LU,3373
122
126
  sentry_sdk/integrations/grpc/consts.py,sha256=NpsN5gKWDmtGtVK_L5HscgFZBHqjOpmLJLGKyh8GZBA,31
@@ -162,9 +166,9 @@ sentry_sdk/profiler/__init__.py,sha256=3PI3bHk9RSkkOXZKN84DDedk_7M65EiqqaIGo-DYs
162
166
  sentry_sdk/profiler/continuous_profiler.py,sha256=7Qb75TaKLNYxMA97wO-qEpDVqxPQWOLUi2rnUm6_Ci0,23066
163
167
  sentry_sdk/profiler/transaction_profiler.py,sha256=e3MsUqs-YIp6-nmzpmBYGoWWIF7RyuSGu24Dj-8GXAU,27970
164
168
  sentry_sdk/profiler/utils.py,sha256=80MF0wiguKe47O-uWQfl-81G1caiVa8HgcFHWBzFpuM,6492
165
- sentry_sdk-2.41.0.dist-info/licenses/LICENSE,sha256=KhQNZg9GKBL6KQvHQNBGMxJsXsRdhLebVp4Sew7t3Qs,1093
166
- sentry_sdk-2.41.0.dist-info/METADATA,sha256=8cH1Csap1vj8PnY9-IRGoQuFSFqZUs4B_USzdXwoH4g,10433
167
- sentry_sdk-2.41.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
168
- sentry_sdk-2.41.0.dist-info/entry_points.txt,sha256=qacZEz40UspQZD1IukCXykx0JtImqGDOctS5KfOLTko,91
169
- sentry_sdk-2.41.0.dist-info/top_level.txt,sha256=XrQz30XE9FKXSY_yGLrd9bsv2Rk390GTDJOSujYaMxI,11
170
- sentry_sdk-2.41.0.dist-info/RECORD,,
169
+ sentry_sdk-2.42.0.dist-info/licenses/LICENSE,sha256=KhQNZg9GKBL6KQvHQNBGMxJsXsRdhLebVp4Sew7t3Qs,1093
170
+ sentry_sdk-2.42.0.dist-info/METADATA,sha256=rsHFGPELP7QwfoPHI1KKqVwK_wBxppb2w3Zd6-S4E68,10523
171
+ sentry_sdk-2.42.0.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
172
+ sentry_sdk-2.42.0.dist-info/entry_points.txt,sha256=qacZEz40UspQZD1IukCXykx0JtImqGDOctS5KfOLTko,91
173
+ sentry_sdk-2.42.0.dist-info/top_level.txt,sha256=XrQz30XE9FKXSY_yGLrd9bsv2Rk390GTDJOSujYaMxI,11
174
+ sentry_sdk-2.42.0.dist-info/RECORD,,