sentry-sdk 2.30.0__py2.py3-none-any.whl → 3.0.0a2__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.

Files changed (109) hide show
  1. sentry_sdk/__init__.py +3 -8
  2. sentry_sdk/_compat.py +0 -1
  3. sentry_sdk/_init_implementation.py +6 -44
  4. sentry_sdk/_types.py +2 -64
  5. sentry_sdk/ai/monitoring.py +14 -10
  6. sentry_sdk/ai/utils.py +1 -1
  7. sentry_sdk/api.py +56 -169
  8. sentry_sdk/client.py +27 -72
  9. sentry_sdk/consts.py +60 -23
  10. sentry_sdk/debug.py +0 -10
  11. sentry_sdk/envelope.py +1 -3
  12. sentry_sdk/feature_flags.py +1 -1
  13. sentry_sdk/integrations/__init__.py +4 -2
  14. sentry_sdk/integrations/_asgi_common.py +5 -6
  15. sentry_sdk/integrations/_wsgi_common.py +11 -40
  16. sentry_sdk/integrations/aiohttp.py +104 -57
  17. sentry_sdk/integrations/anthropic.py +10 -7
  18. sentry_sdk/integrations/arq.py +24 -13
  19. sentry_sdk/integrations/asgi.py +102 -83
  20. sentry_sdk/integrations/asyncio.py +1 -0
  21. sentry_sdk/integrations/asyncpg.py +45 -30
  22. sentry_sdk/integrations/aws_lambda.py +109 -92
  23. sentry_sdk/integrations/boto3.py +38 -9
  24. sentry_sdk/integrations/bottle.py +1 -1
  25. sentry_sdk/integrations/celery/__init__.py +51 -41
  26. sentry_sdk/integrations/clickhouse_driver.py +59 -28
  27. sentry_sdk/integrations/cohere.py +2 -0
  28. sentry_sdk/integrations/django/__init__.py +25 -46
  29. sentry_sdk/integrations/django/asgi.py +6 -2
  30. sentry_sdk/integrations/django/caching.py +13 -22
  31. sentry_sdk/integrations/django/middleware.py +1 -0
  32. sentry_sdk/integrations/django/signals_handlers.py +3 -1
  33. sentry_sdk/integrations/django/templates.py +8 -12
  34. sentry_sdk/integrations/django/transactions.py +1 -6
  35. sentry_sdk/integrations/django/views.py +5 -2
  36. sentry_sdk/integrations/falcon.py +7 -25
  37. sentry_sdk/integrations/fastapi.py +3 -3
  38. sentry_sdk/integrations/flask.py +1 -1
  39. sentry_sdk/integrations/gcp.py +63 -38
  40. sentry_sdk/integrations/graphene.py +6 -13
  41. sentry_sdk/integrations/grpc/aio/client.py +14 -8
  42. sentry_sdk/integrations/grpc/aio/server.py +19 -21
  43. sentry_sdk/integrations/grpc/client.py +8 -6
  44. sentry_sdk/integrations/grpc/server.py +12 -14
  45. sentry_sdk/integrations/httpx.py +47 -12
  46. sentry_sdk/integrations/huey.py +26 -22
  47. sentry_sdk/integrations/huggingface_hub.py +1 -0
  48. sentry_sdk/integrations/langchain.py +22 -15
  49. sentry_sdk/integrations/litestar.py +4 -2
  50. sentry_sdk/integrations/logging.py +7 -2
  51. sentry_sdk/integrations/openai.py +2 -0
  52. sentry_sdk/integrations/pymongo.py +18 -25
  53. sentry_sdk/integrations/pyramid.py +1 -1
  54. sentry_sdk/integrations/quart.py +3 -3
  55. sentry_sdk/integrations/ray.py +23 -17
  56. sentry_sdk/integrations/redis/_async_common.py +29 -18
  57. sentry_sdk/integrations/redis/_sync_common.py +28 -19
  58. sentry_sdk/integrations/redis/modules/caches.py +13 -10
  59. sentry_sdk/integrations/redis/modules/queries.py +14 -11
  60. sentry_sdk/integrations/redis/rb.py +4 -4
  61. sentry_sdk/integrations/redis/redis.py +6 -6
  62. sentry_sdk/integrations/redis/redis_cluster.py +18 -18
  63. sentry_sdk/integrations/redis/redis_py_cluster_legacy.py +4 -4
  64. sentry_sdk/integrations/redis/utils.py +64 -24
  65. sentry_sdk/integrations/rq.py +68 -23
  66. sentry_sdk/integrations/rust_tracing.py +28 -43
  67. sentry_sdk/integrations/sanic.py +23 -13
  68. sentry_sdk/integrations/socket.py +9 -5
  69. sentry_sdk/integrations/sqlalchemy.py +8 -8
  70. sentry_sdk/integrations/starlette.py +11 -31
  71. sentry_sdk/integrations/starlite.py +4 -2
  72. sentry_sdk/integrations/stdlib.py +56 -9
  73. sentry_sdk/integrations/strawberry.py +40 -59
  74. sentry_sdk/integrations/threading.py +10 -26
  75. sentry_sdk/integrations/tornado.py +57 -18
  76. sentry_sdk/integrations/trytond.py +4 -1
  77. sentry_sdk/integrations/wsgi.py +84 -38
  78. sentry_sdk/opentelemetry/__init__.py +9 -0
  79. sentry_sdk/opentelemetry/consts.py +33 -0
  80. sentry_sdk/opentelemetry/contextvars_context.py +81 -0
  81. sentry_sdk/{integrations/opentelemetry → opentelemetry}/propagator.py +19 -28
  82. sentry_sdk/opentelemetry/sampler.py +326 -0
  83. sentry_sdk/opentelemetry/scope.py +218 -0
  84. sentry_sdk/opentelemetry/span_processor.py +335 -0
  85. sentry_sdk/opentelemetry/tracing.py +59 -0
  86. sentry_sdk/opentelemetry/utils.py +484 -0
  87. sentry_sdk/profiler/__init__.py +0 -40
  88. sentry_sdk/profiler/continuous_profiler.py +1 -30
  89. sentry_sdk/profiler/transaction_profiler.py +5 -56
  90. sentry_sdk/scope.py +108 -361
  91. sentry_sdk/sessions.py +0 -87
  92. sentry_sdk/tracing.py +415 -1161
  93. sentry_sdk/tracing_utils.py +130 -166
  94. sentry_sdk/transport.py +4 -104
  95. sentry_sdk/utils.py +169 -152
  96. {sentry_sdk-2.30.0.dist-info → sentry_sdk-3.0.0a2.dist-info}/METADATA +3 -5
  97. sentry_sdk-3.0.0a2.dist-info/RECORD +154 -0
  98. sentry_sdk-3.0.0a2.dist-info/entry_points.txt +2 -0
  99. sentry_sdk/hub.py +0 -739
  100. sentry_sdk/integrations/opentelemetry/__init__.py +0 -7
  101. sentry_sdk/integrations/opentelemetry/consts.py +0 -5
  102. sentry_sdk/integrations/opentelemetry/integration.py +0 -58
  103. sentry_sdk/integrations/opentelemetry/span_processor.py +0 -391
  104. sentry_sdk/metrics.py +0 -965
  105. sentry_sdk-2.30.0.dist-info/RECORD +0 -152
  106. sentry_sdk-2.30.0.dist-info/entry_points.txt +0 -2
  107. {sentry_sdk-2.30.0.dist-info → sentry_sdk-3.0.0a2.dist-info}/WHEEL +0 -0
  108. {sentry_sdk-2.30.0.dist-info → sentry_sdk-3.0.0a2.dist-info}/licenses/LICENSE +0 -0
  109. {sentry_sdk-2.30.0.dist-info → sentry_sdk-3.0.0a2.dist-info}/top_level.txt +0 -0
sentry_sdk/sessions.py CHANGED
@@ -1,6 +1,5 @@
1
1
  import os
2
2
  import time
3
- import warnings
4
3
  from threading import Thread, Lock
5
4
  from contextlib import contextmanager
6
5
 
@@ -18,75 +17,6 @@ if TYPE_CHECKING:
18
17
  from typing import Generator
19
18
  from typing import List
20
19
  from typing import Optional
21
- from typing import Union
22
-
23
-
24
- def is_auto_session_tracking_enabled(hub=None):
25
- # type: (Optional[sentry_sdk.Hub]) -> Union[Any, bool, None]
26
- """DEPRECATED: Utility function to find out if session tracking is enabled."""
27
-
28
- # Internal callers should use private _is_auto_session_tracking_enabled, instead.
29
- warnings.warn(
30
- "This function is deprecated and will be removed in the next major release. "
31
- "There is no public API replacement.",
32
- DeprecationWarning,
33
- stacklevel=2,
34
- )
35
-
36
- if hub is None:
37
- hub = sentry_sdk.Hub.current
38
-
39
- should_track = hub.scope._force_auto_session_tracking
40
-
41
- if should_track is None:
42
- client_options = hub.client.options if hub.client else {}
43
- should_track = client_options.get("auto_session_tracking", False)
44
-
45
- return should_track
46
-
47
-
48
- @contextmanager
49
- def auto_session_tracking(hub=None, session_mode="application"):
50
- # type: (Optional[sentry_sdk.Hub], str) -> Generator[None, None, None]
51
- """DEPRECATED: Use track_session instead
52
- Starts and stops a session automatically around a block.
53
- """
54
- warnings.warn(
55
- "This function is deprecated and will be removed in the next major release. "
56
- "Use track_session instead.",
57
- DeprecationWarning,
58
- stacklevel=2,
59
- )
60
-
61
- if hub is None:
62
- hub = sentry_sdk.Hub.current
63
- with warnings.catch_warnings():
64
- warnings.simplefilter("ignore", DeprecationWarning)
65
- should_track = is_auto_session_tracking_enabled(hub)
66
- if should_track:
67
- hub.start_session(session_mode=session_mode)
68
- try:
69
- yield
70
- finally:
71
- if should_track:
72
- hub.end_session()
73
-
74
-
75
- def is_auto_session_tracking_enabled_scope(scope):
76
- # type: (sentry_sdk.Scope) -> bool
77
- """
78
- DEPRECATED: Utility function to find out if session tracking is enabled.
79
- """
80
-
81
- warnings.warn(
82
- "This function is deprecated and will be removed in the next major release. "
83
- "There is no public API replacement.",
84
- DeprecationWarning,
85
- stacklevel=2,
86
- )
87
-
88
- # Internal callers should use private _is_auto_session_tracking_enabled, instead.
89
- return _is_auto_session_tracking_enabled(scope)
90
20
 
91
21
 
92
22
  def _is_auto_session_tracking_enabled(scope):
@@ -103,23 +33,6 @@ def _is_auto_session_tracking_enabled(scope):
103
33
  return should_track
104
34
 
105
35
 
106
- @contextmanager
107
- def auto_session_tracking_scope(scope, session_mode="application"):
108
- # type: (sentry_sdk.Scope, str) -> Generator[None, None, None]
109
- """DEPRECATED: This function is a deprecated alias for track_session.
110
- Starts and stops a session automatically around a block.
111
- """
112
-
113
- warnings.warn(
114
- "This function is a deprecated alias for track_session and will be removed in the next major release.",
115
- DeprecationWarning,
116
- stacklevel=2,
117
- )
118
-
119
- with track_session(scope, session_mode=session_mode):
120
- yield
121
-
122
-
123
36
  @contextmanager
124
37
  def track_session(scope, session_mode="application"):
125
38
  # type: (sentry_sdk.Scope, str) -> Generator[None, None, None]