sentry-sdk 2.31.0__tar.gz → 2.33.0__tar.gz

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 (201) hide show
  1. {sentry_sdk-2.31.0/sentry_sdk.egg-info → sentry_sdk-2.33.0}/PKG-INFO +1 -1
  2. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/__init__.py +2 -0
  3. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/ai/monitoring.py +7 -3
  4. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/api.py +16 -0
  5. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/consts.py +1 -1
  6. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/asgi.py +19 -3
  7. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/langchain.py +45 -21
  8. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/litestar.py +9 -0
  9. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/ai_client.py +2 -1
  10. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/execute_tool.py +6 -1
  11. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/utils.py +2 -1
  12. sentry_sdk-2.33.0/sentry_sdk/integrations/ray.py +149 -0
  13. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/sessions.py +8 -9
  14. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0/sentry_sdk.egg-info}/PKG-INFO +1 -1
  15. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/setup.py +1 -1
  16. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_api.py +0 -10
  17. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_client.py +2 -1
  18. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_sessions.py +49 -0
  19. sentry_sdk-2.31.0/sentry_sdk/integrations/ray.py +0 -141
  20. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/LICENSE +0 -0
  21. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/MANIFEST.in +0 -0
  22. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/README.md +0 -0
  23. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/pyproject.toml +0 -0
  24. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_compat.py +0 -0
  25. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_init_implementation.py +0 -0
  26. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_log_batcher.py +0 -0
  27. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_lru_cache.py +0 -0
  28. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_queue.py +0 -0
  29. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_types.py +0 -0
  30. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/_werkzeug.py +0 -0
  31. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/ai/__init__.py +0 -0
  32. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/ai/utils.py +0 -0
  33. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/attachments.py +0 -0
  34. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/client.py +0 -0
  35. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/crons/__init__.py +0 -0
  36. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/crons/api.py +0 -0
  37. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/crons/consts.py +0 -0
  38. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/crons/decorator.py +0 -0
  39. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/debug.py +0 -0
  40. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/envelope.py +0 -0
  41. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/feature_flags.py +0 -0
  42. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/hub.py +0 -0
  43. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/__init__.py +0 -0
  44. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/_asgi_common.py +0 -0
  45. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/_wsgi_common.py +0 -0
  46. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/aiohttp.py +0 -0
  47. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/anthropic.py +0 -0
  48. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/argv.py +0 -0
  49. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/ariadne.py +0 -0
  50. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/arq.py +0 -0
  51. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/asyncio.py +0 -0
  52. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/asyncpg.py +0 -0
  53. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/atexit.py +0 -0
  54. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/aws_lambda.py +0 -0
  55. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/beam.py +0 -0
  56. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/boto3.py +0 -0
  57. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/bottle.py +0 -0
  58. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/celery/__init__.py +0 -0
  59. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/celery/beat.py +0 -0
  60. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/celery/utils.py +0 -0
  61. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/chalice.py +0 -0
  62. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/clickhouse_driver.py +0 -0
  63. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/cloud_resource_context.py +0 -0
  64. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/cohere.py +0 -0
  65. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/dedupe.py +0 -0
  66. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/__init__.py +0 -0
  67. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/asgi.py +0 -0
  68. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/caching.py +0 -0
  69. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/middleware.py +0 -0
  70. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/signals_handlers.py +0 -0
  71. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/templates.py +0 -0
  72. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/transactions.py +0 -0
  73. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/django/views.py +0 -0
  74. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/dramatiq.py +0 -0
  75. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/excepthook.py +0 -0
  76. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/executing.py +0 -0
  77. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/falcon.py +0 -0
  78. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/fastapi.py +0 -0
  79. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/flask.py +0 -0
  80. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/gcp.py +0 -0
  81. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/gnu_backtrace.py +0 -0
  82. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/gql.py +0 -0
  83. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/graphene.py +0 -0
  84. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/__init__.py +0 -0
  85. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/aio/__init__.py +0 -0
  86. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/aio/client.py +0 -0
  87. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/aio/server.py +0 -0
  88. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/client.py +0 -0
  89. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/consts.py +0 -0
  90. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/grpc/server.py +0 -0
  91. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/httpx.py +0 -0
  92. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/huey.py +0 -0
  93. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/huggingface_hub.py +0 -0
  94. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/launchdarkly.py +0 -0
  95. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/logging.py +0 -0
  96. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/loguru.py +0 -0
  97. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/modules.py +0 -0
  98. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai.py +0 -0
  99. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/__init__.py +0 -0
  100. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/consts.py +0 -0
  101. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/patches/__init__.py +0 -0
  102. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/patches/agent_run.py +0 -0
  103. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/patches/models.py +0 -0
  104. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/patches/runner.py +0 -0
  105. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/patches/tools.py +0 -0
  106. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/__init__.py +0 -0
  107. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/agent_workflow.py +0 -0
  108. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/handoff.py +0 -0
  109. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openai_agents/spans/invoke_agent.py +0 -0
  110. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/openfeature.py +0 -0
  111. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/opentelemetry/__init__.py +0 -0
  112. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/opentelemetry/consts.py +0 -0
  113. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/opentelemetry/integration.py +0 -0
  114. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/opentelemetry/propagator.py +0 -0
  115. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/opentelemetry/span_processor.py +0 -0
  116. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/pure_eval.py +0 -0
  117. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/pymongo.py +0 -0
  118. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/pyramid.py +0 -0
  119. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/quart.py +0 -0
  120. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/__init__.py +0 -0
  121. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/_async_common.py +0 -0
  122. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/_sync_common.py +0 -0
  123. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/consts.py +0 -0
  124. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/modules/__init__.py +0 -0
  125. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/modules/caches.py +0 -0
  126. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/modules/queries.py +0 -0
  127. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/rb.py +0 -0
  128. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/redis.py +0 -0
  129. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/redis_cluster.py +0 -0
  130. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/redis_py_cluster_legacy.py +0 -0
  131. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/redis/utils.py +0 -0
  132. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/rq.py +0 -0
  133. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/rust_tracing.py +0 -0
  134. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/sanic.py +0 -0
  135. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/serverless.py +0 -0
  136. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/socket.py +0 -0
  137. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/spark/__init__.py +0 -0
  138. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/spark/spark_driver.py +0 -0
  139. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/spark/spark_worker.py +0 -0
  140. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/sqlalchemy.py +0 -0
  141. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/starlette.py +0 -0
  142. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/starlite.py +0 -0
  143. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/statsig.py +0 -0
  144. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/stdlib.py +0 -0
  145. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/strawberry.py +0 -0
  146. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/sys_exit.py +0 -0
  147. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/threading.py +0 -0
  148. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/tornado.py +0 -0
  149. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/trytond.py +0 -0
  150. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/typer.py +0 -0
  151. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/unleash.py +0 -0
  152. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/integrations/wsgi.py +0 -0
  153. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/logger.py +0 -0
  154. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/metrics.py +0 -0
  155. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/monitor.py +0 -0
  156. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/profiler/__init__.py +0 -0
  157. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/profiler/continuous_profiler.py +0 -0
  158. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/profiler/transaction_profiler.py +0 -0
  159. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/profiler/utils.py +0 -0
  160. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/py.typed +0 -0
  161. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/scope.py +0 -0
  162. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/scrubber.py +0 -0
  163. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/serializer.py +0 -0
  164. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/session.py +0 -0
  165. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/spotlight.py +0 -0
  166. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/tracing.py +0 -0
  167. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/tracing_utils.py +0 -0
  168. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/transport.py +0 -0
  169. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/types.py +0 -0
  170. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/utils.py +0 -0
  171. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk/worker.py +0 -0
  172. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/SOURCES.txt +0 -0
  173. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/dependency_links.txt +0 -0
  174. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/entry_points.txt +0 -0
  175. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/not-zip-safe +0 -0
  176. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/requires.txt +0 -0
  177. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/sentry_sdk.egg-info/top_level.txt +0 -0
  178. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/setup.cfg +0 -0
  179. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_ai_monitoring.py +0 -0
  180. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_basics.py +0 -0
  181. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_conftest.py +0 -0
  182. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_crons.py +0 -0
  183. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_dsc.py +0 -0
  184. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_envelope.py +0 -0
  185. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_exceptiongroup.py +0 -0
  186. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_feature_flags.py +0 -0
  187. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_full_stack_frames.py +0 -0
  188. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_import.py +0 -0
  189. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_logs.py +0 -0
  190. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_lru_cache.py +0 -0
  191. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_metrics.py +0 -0
  192. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_monitor.py +0 -0
  193. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_propagationcontext.py +0 -0
  194. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_scope.py +0 -0
  195. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_scrubber.py +0 -0
  196. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_serializer.py +0 -0
  197. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_spotlight.py +0 -0
  198. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_tracing_utils.py +0 -0
  199. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_transport.py +0 -0
  200. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_types.py +0 -0
  201. {sentry_sdk-2.31.0 → sentry_sdk-2.33.0}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry-sdk
3
- Version: 2.31.0
3
+ Version: 2.33.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
@@ -47,6 +47,8 @@ __all__ = [ # noqa
47
47
  "trace",
48
48
  "monitor",
49
49
  "logger",
50
+ "start_session",
51
+ "end_session",
50
52
  ]
51
53
 
52
54
  # Initialize the debug support after everything is loaded
@@ -102,15 +102,19 @@ def record_token_usage(
102
102
  ai_pipeline_name = get_ai_pipeline_name()
103
103
  if ai_pipeline_name:
104
104
  span.set_data(SPANDATA.AI_PIPELINE_NAME, ai_pipeline_name)
105
+
105
106
  if prompt_tokens is not None:
106
- span.set_measurement("ai_prompt_tokens_used", value=prompt_tokens)
107
+ span.set_data(SPANDATA.GEN_AI_USAGE_INPUT_TOKENS, prompt_tokens)
108
+
107
109
  if completion_tokens is not None:
108
- span.set_measurement("ai_completion_tokens_used", value=completion_tokens)
110
+ span.set_data(SPANDATA.GEN_AI_USAGE_OUTPUT_TOKENS, completion_tokens)
111
+
109
112
  if (
110
113
  total_tokens is None
111
114
  and prompt_tokens is not None
112
115
  and completion_tokens is not None
113
116
  ):
114
117
  total_tokens = prompt_tokens + completion_tokens
118
+
115
119
  if total_tokens is not None:
116
- span.set_measurement("ai_total_tokens_used", total_tokens)
120
+ span.set_data(SPANDATA.GEN_AI_USAGE_TOTAL_TOKENS, total_tokens)
@@ -82,6 +82,8 @@ __all__ = [
82
82
  "start_transaction",
83
83
  "trace",
84
84
  "monitor",
85
+ "start_session",
86
+ "end_session",
85
87
  ]
86
88
 
87
89
 
@@ -450,3 +452,17 @@ def continue_trace(
450
452
  return get_isolation_scope().continue_trace(
451
453
  environ_or_headers, op, name, source, origin
452
454
  )
455
+
456
+
457
+ @scopemethod
458
+ def start_session(
459
+ session_mode="application", # type: str
460
+ ):
461
+ # type: (...) -> None
462
+ return get_isolation_scope().start_session(session_mode=session_mode)
463
+
464
+
465
+ @scopemethod
466
+ def end_session():
467
+ # type: () -> None
468
+ return get_isolation_scope().end_session()
@@ -1181,4 +1181,4 @@ DEFAULT_OPTIONS = _get_default_options()
1181
1181
  del _get_default_options
1182
1182
 
1183
1183
 
1184
- VERSION = "2.31.0"
1184
+ VERSION = "2.33.0"
@@ -145,6 +145,22 @@ class SentryAsgiMiddleware:
145
145
  else:
146
146
  self.__call__ = self._run_asgi2
147
147
 
148
+ def _capture_lifespan_exception(self, exc):
149
+ # type: (Exception) -> None
150
+ """Capture exceptions raise in application lifespan handlers.
151
+
152
+ The separate function is needed to support overriding in derived integrations that use different catching mechanisms.
153
+ """
154
+ return _capture_exception(exc=exc, mechanism_type=self.mechanism_type)
155
+
156
+ def _capture_request_exception(self, exc):
157
+ # type: (Exception) -> None
158
+ """Capture exceptions raised in incoming request handlers.
159
+
160
+ The separate function is needed to support overriding in derived integrations that use different catching mechanisms.
161
+ """
162
+ return _capture_exception(exc=exc, mechanism_type=self.mechanism_type)
163
+
148
164
  def _run_asgi2(self, scope):
149
165
  # type: (Any) -> Any
150
166
  async def inner(receive, send):
@@ -158,7 +174,7 @@ class SentryAsgiMiddleware:
158
174
  return await self._run_app(scope, receive, send, asgi_version=3)
159
175
 
160
176
  async def _run_app(self, scope, receive, send, asgi_version):
161
- # type: (Any, Any, Any, Any, int) -> Any
177
+ # type: (Any, Any, Any, int) -> Any
162
178
  is_recursive_asgi_middleware = _asgi_middleware_applied.get(False)
163
179
  is_lifespan = scope["type"] == "lifespan"
164
180
  if is_recursive_asgi_middleware or is_lifespan:
@@ -169,7 +185,7 @@ class SentryAsgiMiddleware:
169
185
  return await self.app(scope, receive, send)
170
186
 
171
187
  except Exception as exc:
172
- _capture_exception(exc, mechanism_type=self.mechanism_type)
188
+ self._capture_lifespan_exception(exc)
173
189
  raise exc from None
174
190
 
175
191
  _asgi_middleware_applied.set(True)
@@ -256,7 +272,7 @@ class SentryAsgiMiddleware:
256
272
  scope, receive, _sentry_wrapped_send
257
273
  )
258
274
  except Exception as exc:
259
- _capture_exception(exc, mechanism_type=self.mechanism_type)
275
+ self._capture_request_exception(exc)
260
276
  raise exc from None
261
277
  finally:
262
278
  _asgi_middleware_applied.set(False)
@@ -1,3 +1,4 @@
1
+ import itertools
1
2
  from collections import OrderedDict
2
3
  from functools import wraps
3
4
 
@@ -22,6 +23,7 @@ try:
22
23
  from langchain_core.callbacks import (
23
24
  manager,
24
25
  BaseCallbackHandler,
26
+ BaseCallbackManager,
25
27
  Callbacks,
26
28
  )
27
29
  from langchain_core.agents import AgentAction, AgentFinish
@@ -88,12 +90,9 @@ class WatchedSpan:
88
90
  class SentryLangchainCallback(BaseCallbackHandler): # type: ignore[misc]
89
91
  """Base callback handler that can be used to handle callbacks from langchain."""
90
92
 
91
- span_map = OrderedDict() # type: OrderedDict[UUID, WatchedSpan]
92
-
93
- max_span_map_size = 0
94
-
95
93
  def __init__(self, max_span_map_size, include_prompts, tiktoken_encoding_name=None):
96
94
  # type: (int, bool, Optional[str]) -> None
95
+ self.span_map = OrderedDict() # type: OrderedDict[UUID, WatchedSpan]
97
96
  self.max_span_map_size = max_span_map_size
98
97
  self.include_prompts = include_prompts
99
98
 
@@ -436,12 +435,20 @@ def _wrap_configure(f):
436
435
  **kwargs,
437
436
  )
438
437
 
439
- callbacks_list = local_callbacks or []
440
-
441
- if isinstance(callbacks_list, BaseCallbackHandler):
442
- callbacks_list = [callbacks_list]
443
- elif not isinstance(callbacks_list, list):
444
- logger.debug("Unknown callback type: %s", callbacks_list)
438
+ local_callbacks = local_callbacks or []
439
+
440
+ # Handle each possible type of local_callbacks. For each type, we
441
+ # extract the list of callbacks to check for SentryLangchainCallback,
442
+ # and define a function that would add the SentryLangchainCallback
443
+ # to the existing callbacks list.
444
+ if isinstance(local_callbacks, BaseCallbackManager):
445
+ callbacks_list = local_callbacks.handlers
446
+ elif isinstance(local_callbacks, BaseCallbackHandler):
447
+ callbacks_list = [local_callbacks]
448
+ elif isinstance(local_callbacks, list):
449
+ callbacks_list = local_callbacks
450
+ else:
451
+ logger.debug("Unknown callback type: %s", local_callbacks)
445
452
  # Just proceed with original function call
446
453
  return f(
447
454
  callback_manager_cls,
@@ -451,21 +458,38 @@ def _wrap_configure(f):
451
458
  **kwargs,
452
459
  )
453
460
 
454
- if not any(isinstance(cb, SentryLangchainCallback) for cb in callbacks_list):
455
- # Avoid mutating the existing callbacks list
456
- callbacks_list = [
457
- *callbacks_list,
458
- SentryLangchainCallback(
459
- integration.max_spans,
460
- integration.include_prompts,
461
- integration.tiktoken_encoding_name,
462
- ),
463
- ]
461
+ # Handle each possible type of inheritable_callbacks.
462
+ if isinstance(inheritable_callbacks, BaseCallbackManager):
463
+ inheritable_callbacks_list = inheritable_callbacks.handlers
464
+ elif isinstance(inheritable_callbacks, list):
465
+ inheritable_callbacks_list = inheritable_callbacks
466
+ else:
467
+ inheritable_callbacks_list = []
468
+
469
+ if not any(
470
+ isinstance(cb, SentryLangchainCallback)
471
+ for cb in itertools.chain(callbacks_list, inheritable_callbacks_list)
472
+ ):
473
+ sentry_handler = SentryLangchainCallback(
474
+ integration.max_spans,
475
+ integration.include_prompts,
476
+ integration.tiktoken_encoding_name,
477
+ )
478
+ if isinstance(local_callbacks, BaseCallbackManager):
479
+ local_callbacks = local_callbacks.copy()
480
+ local_callbacks.handlers = [
481
+ *local_callbacks.handlers,
482
+ sentry_handler,
483
+ ]
484
+ elif isinstance(local_callbacks, BaseCallbackHandler):
485
+ local_callbacks = [local_callbacks, sentry_handler]
486
+ else: # local_callbacks is a list
487
+ local_callbacks = [*local_callbacks, sentry_handler]
464
488
 
465
489
  return f(
466
490
  callback_manager_cls,
467
491
  inheritable_callbacks,
468
- callbacks_list,
492
+ local_callbacks,
469
493
  *args,
470
494
  **kwargs,
471
495
  )
@@ -87,6 +87,15 @@ class SentryLitestarASGIMiddleware(SentryAsgiMiddleware):
87
87
  span_origin=span_origin,
88
88
  )
89
89
 
90
+ def _capture_request_exception(self, exc):
91
+ # type: (Exception) -> None
92
+ """Avoid catching exceptions from request handlers.
93
+
94
+ Those exceptions are already handled in Litestar.after_exception handler.
95
+ We still catch exceptions from application lifespan handlers.
96
+ """
97
+ pass
98
+
90
99
 
91
100
  def patch_app_init():
92
101
  # type: () -> None
@@ -19,9 +19,10 @@ if TYPE_CHECKING:
19
19
  def ai_client_span(agent, get_response_kwargs):
20
20
  # type: (Agent, dict[str, Any]) -> sentry_sdk.tracing.Span
21
21
  # TODO-anton: implement other types of operations. Now "chat" is hardcoded.
22
+ model_name = agent.model.model if hasattr(agent.model, "model") else agent.model
22
23
  span = sentry_sdk.start_span(
23
24
  op=OP.GEN_AI_CHAT,
24
- description=f"chat {agent.model}",
25
+ description=f"chat {model_name}",
25
26
  origin=SPAN_ORIGIN,
26
27
  )
27
28
  # TODO-anton: remove hardcoded stuff and replace something that also works for embedding and so on
@@ -1,5 +1,5 @@
1
1
  import sentry_sdk
2
- from sentry_sdk.consts import OP, SPANDATA
2
+ from sentry_sdk.consts import OP, SPANDATA, SPANSTATUS
3
3
  from sentry_sdk.scope import should_send_default_pii
4
4
 
5
5
  from ..consts import SPAN_ORIGIN
@@ -39,5 +39,10 @@ def update_execute_tool_span(span, agent, tool, result):
39
39
  # type: (sentry_sdk.tracing.Span, agents.Agent, agents.Tool, Any) -> None
40
40
  _set_agent_data(span, agent)
41
41
 
42
+ if isinstance(result, str) and result.startswith(
43
+ "An error occurred while running the tool"
44
+ ):
45
+ span.set_status(SPANSTATUS.INTERNAL_ERROR)
46
+
42
47
  if should_send_default_pii():
43
48
  span.set_data(SPANDATA.GEN_AI_TOOL_OUTPUT, result)
@@ -53,7 +53,8 @@ def _set_agent_data(span, agent):
53
53
  )
54
54
 
55
55
  if agent.model:
56
- span.set_data(SPANDATA.GEN_AI_REQUEST_MODEL, agent.model)
56
+ model_name = agent.model.model if hasattr(agent.model, "model") else agent.model
57
+ span.set_data(SPANDATA.GEN_AI_REQUEST_MODEL, model_name)
57
58
 
58
59
  if agent.model_settings.presence_penalty:
59
60
  span.set_data(
@@ -0,0 +1,149 @@
1
+ import inspect
2
+ import sys
3
+
4
+ import sentry_sdk
5
+ from sentry_sdk.consts import OP, SPANSTATUS
6
+ from sentry_sdk.integrations import _check_minimum_version, DidNotEnable, Integration
7
+ from sentry_sdk.tracing import TransactionSource
8
+ from sentry_sdk.utils import (
9
+ event_from_exception,
10
+ logger,
11
+ package_version,
12
+ qualname_from_function,
13
+ reraise,
14
+ )
15
+
16
+ try:
17
+ import ray # type: ignore[import-not-found]
18
+ except ImportError:
19
+ raise DidNotEnable("Ray not installed.")
20
+ import functools
21
+
22
+ from typing import TYPE_CHECKING
23
+
24
+ if TYPE_CHECKING:
25
+ from collections.abc import Callable
26
+ from typing import Any, Optional
27
+ from sentry_sdk.utils import ExcInfo
28
+
29
+
30
+ def _check_sentry_initialized():
31
+ # type: () -> None
32
+ if sentry_sdk.get_client().is_active():
33
+ return
34
+
35
+ logger.debug(
36
+ "[Tracing] Sentry not initialized in ray cluster worker, performance data will be discarded."
37
+ )
38
+
39
+
40
+ def _patch_ray_remote():
41
+ # type: () -> None
42
+ old_remote = ray.remote
43
+
44
+ @functools.wraps(old_remote)
45
+ def new_remote(f=None, *args, **kwargs):
46
+ # type: (Optional[Callable[..., Any]], *Any, **Any) -> Callable[..., Any]
47
+
48
+ if inspect.isclass(f):
49
+ # Ray Actors
50
+ # (https://docs.ray.io/en/latest/ray-core/actors.html)
51
+ # are not supported
52
+ # (Only Ray Tasks are supported)
53
+ return old_remote(f, *args, **kwargs)
54
+
55
+ def wrapper(user_f):
56
+ # type: (Callable[..., Any]) -> Any
57
+ def new_func(*f_args, _tracing=None, **f_kwargs):
58
+ # type: (Any, Optional[dict[str, Any]], Any) -> Any
59
+ _check_sentry_initialized()
60
+
61
+ transaction = sentry_sdk.continue_trace(
62
+ _tracing or {},
63
+ op=OP.QUEUE_TASK_RAY,
64
+ name=qualname_from_function(user_f),
65
+ origin=RayIntegration.origin,
66
+ source=TransactionSource.TASK,
67
+ )
68
+
69
+ with sentry_sdk.start_transaction(transaction) as transaction:
70
+ try:
71
+ result = user_f(*f_args, **f_kwargs)
72
+ transaction.set_status(SPANSTATUS.OK)
73
+ except Exception:
74
+ transaction.set_status(SPANSTATUS.INTERNAL_ERROR)
75
+ exc_info = sys.exc_info()
76
+ _capture_exception(exc_info)
77
+ reraise(*exc_info)
78
+
79
+ return result
80
+
81
+ if f:
82
+ rv = old_remote(new_func)
83
+ else:
84
+ rv = old_remote(*args, **kwargs)(new_func)
85
+ old_remote_method = rv.remote
86
+
87
+ def _remote_method_with_header_propagation(*args, **kwargs):
88
+ # type: (*Any, **Any) -> Any
89
+ """
90
+ Ray Client
91
+ """
92
+ with sentry_sdk.start_span(
93
+ op=OP.QUEUE_SUBMIT_RAY,
94
+ name=qualname_from_function(user_f),
95
+ origin=RayIntegration.origin,
96
+ ) as span:
97
+ tracing = {
98
+ k: v
99
+ for k, v in sentry_sdk.get_current_scope().iter_trace_propagation_headers()
100
+ }
101
+ try:
102
+ result = old_remote_method(*args, **kwargs, _tracing=tracing)
103
+ span.set_status(SPANSTATUS.OK)
104
+ except Exception:
105
+ span.set_status(SPANSTATUS.INTERNAL_ERROR)
106
+ exc_info = sys.exc_info()
107
+ _capture_exception(exc_info)
108
+ reraise(*exc_info)
109
+
110
+ return result
111
+
112
+ rv.remote = _remote_method_with_header_propagation
113
+
114
+ return rv
115
+
116
+ if f is not None:
117
+ return wrapper(f)
118
+ else:
119
+ return wrapper
120
+
121
+ ray.remote = new_remote
122
+
123
+
124
+ def _capture_exception(exc_info, **kwargs):
125
+ # type: (ExcInfo, **Any) -> None
126
+ client = sentry_sdk.get_client()
127
+
128
+ event, hint = event_from_exception(
129
+ exc_info,
130
+ client_options=client.options,
131
+ mechanism={
132
+ "handled": False,
133
+ "type": RayIntegration.identifier,
134
+ },
135
+ )
136
+ sentry_sdk.capture_event(event, hint=hint)
137
+
138
+
139
+ class RayIntegration(Integration):
140
+ identifier = "ray"
141
+ origin = f"auto.queue.{identifier}"
142
+
143
+ @staticmethod
144
+ def setup_once():
145
+ # type: () -> None
146
+ version = package_version("ray")
147
+ _check_minimum_version(RayIntegration, version)
148
+
149
+ _patch_ray_remote()
@@ -1,7 +1,6 @@
1
1
  import os
2
- import time
3
2
  import warnings
4
- from threading import Thread, Lock
3
+ from threading import Thread, Lock, Event
5
4
  from contextlib import contextmanager
6
5
 
7
6
  import sentry_sdk
@@ -162,7 +161,7 @@ class SessionFlusher:
162
161
  self._thread_lock = Lock()
163
162
  self._aggregate_lock = Lock()
164
163
  self._thread_for_pid = None # type: Optional[int]
165
- self._running = True
164
+ self.__shutdown_requested = Event()
166
165
 
167
166
  def flush(self):
168
167
  # type: (...) -> None
@@ -208,10 +207,10 @@ class SessionFlusher:
208
207
 
209
208
  def _thread():
210
209
  # type: (...) -> None
211
- while self._running:
212
- time.sleep(self.flush_interval)
213
- if self._running:
214
- self.flush()
210
+ running = True
211
+ while running:
212
+ running = not self.__shutdown_requested.wait(self.flush_interval)
213
+ self.flush()
215
214
 
216
215
  thread = Thread(target=_thread)
217
216
  thread.daemon = True
@@ -220,7 +219,7 @@ class SessionFlusher:
220
219
  except RuntimeError:
221
220
  # Unfortunately at this point the interpreter is in a state that no
222
221
  # longer allows us to spawn a thread and we have to bail.
223
- self._running = False
222
+ self.__shutdown_requested.set()
224
223
  return None
225
224
 
226
225
  self._thread = thread
@@ -271,7 +270,7 @@ class SessionFlusher:
271
270
 
272
271
  def kill(self):
273
272
  # type: (...) -> None
274
- self._running = False
273
+ self.__shutdown_requested.set()
275
274
 
276
275
  def __del__(self):
277
276
  # type: (...) -> None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry-sdk
3
- Version: 2.31.0
3
+ Version: 2.33.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
@@ -21,7 +21,7 @@ def get_file_text(file_name):
21
21
 
22
22
  setup(
23
23
  name="sentry-sdk",
24
- version="2.31.0",
24
+ version="2.33.0",
25
25
  author="Sentry Team and Contributors",
26
26
  author_email="hello@sentry.io",
27
27
  url="https://github.com/getsentry/sentry-python",
@@ -24,7 +24,6 @@ from sentry_sdk import (
24
24
  from sentry_sdk.client import Client, NonRecordingClient
25
25
 
26
26
 
27
- @pytest.mark.forked
28
27
  def test_get_current_span():
29
28
  fake_scope = mock.MagicMock()
30
29
  fake_scope.span = mock.MagicMock()
@@ -34,7 +33,6 @@ def test_get_current_span():
34
33
  assert get_current_span(fake_scope) is None
35
34
 
36
35
 
37
- @pytest.mark.forked
38
36
  def test_get_current_span_default_hub(sentry_init):
39
37
  sentry_init()
40
38
 
@@ -47,7 +45,6 @@ def test_get_current_span_default_hub(sentry_init):
47
45
  assert get_current_span() == fake_span
48
46
 
49
47
 
50
- @pytest.mark.forked
51
48
  def test_get_current_span_default_hub_with_transaction(sentry_init):
52
49
  sentry_init()
53
50
 
@@ -57,7 +54,6 @@ def test_get_current_span_default_hub_with_transaction(sentry_init):
57
54
  assert get_current_span() == new_transaction
58
55
 
59
56
 
60
- @pytest.mark.forked
61
57
  def test_traceparent_with_tracing_enabled(sentry_init):
62
58
  sentry_init(traces_sample_rate=1.0)
63
59
 
@@ -69,7 +65,6 @@ def test_traceparent_with_tracing_enabled(sentry_init):
69
65
  assert get_traceparent() == expected_traceparent
70
66
 
71
67
 
72
- @pytest.mark.forked
73
68
  def test_traceparent_with_tracing_disabled(sentry_init):
74
69
  sentry_init()
75
70
 
@@ -81,7 +76,6 @@ def test_traceparent_with_tracing_disabled(sentry_init):
81
76
  assert get_traceparent() == expected_traceparent
82
77
 
83
78
 
84
- @pytest.mark.forked
85
79
  def test_baggage_with_tracing_disabled(sentry_init):
86
80
  sentry_init(release="1.0.0", environment="dev")
87
81
  propagation_context = get_isolation_scope()._propagation_context
@@ -93,7 +87,6 @@ def test_baggage_with_tracing_disabled(sentry_init):
93
87
  assert get_baggage() == expected_baggage
94
88
 
95
89
 
96
- @pytest.mark.forked
97
90
  def test_baggage_with_tracing_enabled(sentry_init):
98
91
  sentry_init(traces_sample_rate=1.0, release="1.0.0", environment="dev")
99
92
  with start_transaction() as transaction:
@@ -103,7 +96,6 @@ def test_baggage_with_tracing_enabled(sentry_init):
103
96
  assert re.match(expected_baggage_re, get_baggage())
104
97
 
105
98
 
106
- @pytest.mark.forked
107
99
  def test_continue_trace(sentry_init):
108
100
  sentry_init()
109
101
 
@@ -130,7 +122,6 @@ def test_continue_trace(sentry_init):
130
122
  }
131
123
 
132
124
 
133
- @pytest.mark.forked
134
125
  def test_is_initialized():
135
126
  assert not is_initialized()
136
127
 
@@ -139,7 +130,6 @@ def test_is_initialized():
139
130
  assert is_initialized()
140
131
 
141
132
 
142
- @pytest.mark.forked
143
133
  def test_get_client():
144
134
  client = get_client()
145
135
  assert client is not None
@@ -1297,7 +1297,6 @@ def test_error_sampler(_, sentry_init, capture_events, test_config):
1297
1297
  assert len(test_config.sampler_function_mock.call_args[0]) == 2
1298
1298
 
1299
1299
 
1300
- @pytest.mark.forked
1301
1300
  @pytest.mark.parametrize(
1302
1301
  "opt,missing_flags",
1303
1302
  [
@@ -1342,6 +1341,8 @@ class TestSpanClientReports:
1342
1341
  Tests for client reports related to spans.
1343
1342
  """
1344
1343
 
1344
+ __test__ = False
1345
+
1345
1346
  @staticmethod
1346
1347
  def span_dropper(spans_to_drop):
1347
1348
  """
@@ -246,3 +246,52 @@ def test_no_thread_on_shutdown_no_errors_deprecated(
246
246
  sentry_sdk.flush()
247
247
 
248
248
  # If we reach this point without error, the test is successful.
249
+
250
+
251
+ def test_top_level_start_session_basic(sentry_init, capture_envelopes):
252
+ """Test that top-level start_session starts a session on the isolation scope."""
253
+ sentry_init(release="test-release", environment="test-env")
254
+ envelopes = capture_envelopes()
255
+
256
+ # Start a session using the top-level API
257
+ sentry_sdk.start_session()
258
+
259
+ # End the session
260
+ sentry_sdk.end_session()
261
+ sentry_sdk.flush()
262
+
263
+ # Check that we got a session envelope
264
+ assert len(envelopes) == 1
265
+ sess = envelopes[0]
266
+ assert len(sess.items) == 1
267
+ sess_event = sess.items[0].payload.json
268
+
269
+ assert sess_event["attrs"] == {
270
+ "release": "test-release",
271
+ "environment": "test-env",
272
+ }
273
+ assert sess_event["status"] == "exited"
274
+
275
+
276
+ def test_top_level_start_session_with_mode(sentry_init, capture_envelopes):
277
+ """Test that top-level start_session accepts session_mode parameter."""
278
+ sentry_init(release="test-release", environment="test-env")
279
+ envelopes = capture_envelopes()
280
+
281
+ # Start a session with request mode
282
+ sentry_sdk.start_session(session_mode="request")
283
+ sentry_sdk.end_session()
284
+ sentry_sdk.flush()
285
+
286
+ # Request mode sessions are aggregated
287
+ assert len(envelopes) == 1
288
+ sess = envelopes[0]
289
+ assert len(sess.items) == 1
290
+ sess_event = sess.items[0].payload.json
291
+
292
+ assert sess_event["attrs"] == {
293
+ "release": "test-release",
294
+ "environment": "test-env",
295
+ }
296
+ # Request sessions show up as aggregates
297
+ assert "aggregates" in sess_event