sentry-sdk 2.35.1__py2.py3-none-any.whl → 2.35.2__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.

sentry_sdk/consts.py CHANGED
@@ -1329,4 +1329,4 @@ DEFAULT_OPTIONS = _get_default_options()
1329
1329
  del _get_default_options
1330
1330
 
1331
1331
 
1332
- VERSION = "2.35.1"
1332
+ VERSION = "2.35.2"
@@ -356,12 +356,14 @@ class SentryLogsHandler(_BaseHandler):
356
356
  record.levelno, SEVERITY_TO_OTEL_SEVERITY
357
357
  )
358
358
  project_root = client.options["project_root"]
359
+
359
360
  attrs = self._extra_from_record(record) # type: Any
360
361
  attrs["sentry.origin"] = "auto.logger.log"
361
- if isinstance(record.msg, str):
362
- attrs["sentry.message.template"] = record.msg
362
+
363
+ parameters_set = False
363
364
  if record.args is not None:
364
365
  if isinstance(record.args, tuple):
366
+ parameters_set = bool(record.args)
365
367
  for i, arg in enumerate(record.args):
366
368
  attrs[f"sentry.message.parameter.{i}"] = (
367
369
  arg
@@ -369,19 +371,28 @@ class SentryLogsHandler(_BaseHandler):
369
371
  else safe_repr(arg)
370
372
  )
371
373
  elif isinstance(record.args, dict):
374
+ parameters_set = bool(record.args)
372
375
  for key, value in record.args.items():
373
376
  attrs[f"sentry.message.parameter.{key}"] = (
374
377
  value
375
378
  if isinstance(value, (str, float, int, bool))
376
379
  else safe_repr(value)
377
380
  )
381
+
382
+ if parameters_set and isinstance(record.msg, str):
383
+ # only include template if there is at least one
384
+ # sentry.message.parameter.X set
385
+ attrs["sentry.message.template"] = record.msg
386
+
378
387
  if record.lineno:
379
388
  attrs["code.line.number"] = record.lineno
389
+
380
390
  if record.pathname:
381
391
  if project_root is not None and record.pathname.startswith(project_root):
382
392
  attrs["code.file.path"] = record.pathname[len(project_root) + 1 :]
383
393
  else:
384
394
  attrs["code.file.path"] = record.pathname
395
+
385
396
  if record.funcName:
386
397
  attrs["code.function.name"] = record.funcName
387
398
 
sentry_sdk/logger.py CHANGED
@@ -22,13 +22,14 @@ def _capture_log(severity_text, severity_number, template, **kwargs):
22
22
  # type: (str, int, str, **Any) -> None
23
23
  client = get_client()
24
24
 
25
- attrs = {
26
- "sentry.message.template": template,
27
- } # type: dict[str, str | bool | float | int]
25
+ attrs = {} # type: dict[str, str | bool | float | int]
28
26
  if "attributes" in kwargs:
29
27
  attrs.update(kwargs.pop("attributes"))
30
28
  for k, v in kwargs.items():
31
29
  attrs[f"sentry.message.parameter.{k}"] = v
30
+ if kwargs:
31
+ # only attach template if there are parameters
32
+ attrs["sentry.message.template"] = template
32
33
 
33
34
  attrs = {
34
35
  k: (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sentry-sdk
3
- Version: 2.35.1
3
+ Version: 2.35.2
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
@@ -9,12 +9,12 @@ sentry_sdk/_werkzeug.py,sha256=m3GPf-jHd8v3eVOfBHaKw5f0uHoLkXrSO1EcY-8EisY,3734
9
9
  sentry_sdk/api.py,sha256=OkwQ2tA5YASJ77wLOteUdv_woPF4wL_JTOAMxe9z8k4,15282
10
10
  sentry_sdk/attachments.py,sha256=0Dylhm065O6hNFjB40fWCd5Hg4qWSXndmi1TPWglZkI,3109
11
11
  sentry_sdk/client.py,sha256=oQcolwFdLvuX4huUaCcpgABy3M5Yb4IhzymlzyrqfkE,38860
12
- sentry_sdk/consts.py,sha256=MfjbaXeUP3zZu7u--NP32syNjlppzDW5Ke7tN7D6aSI,49767
12
+ sentry_sdk/consts.py,sha256=18Xty_-BsOAFVppLK2qz--7EjhyEp80Lr9d6ZCYJgEw,49767
13
13
  sentry_sdk/debug.py,sha256=ddBehQlAuQC1sg1XO-N4N3diZ0x0iT5RWJwFdrtcsjw,1019
14
14
  sentry_sdk/envelope.py,sha256=Mgcib0uLm_5tSVzOrznRLdK9B3CjQ6TEgM1ZIZIfjWo,10355
15
15
  sentry_sdk/feature_flags.py,sha256=99JRig6TBkrkBzVCKqYcmVgjsuA_Hk-ul7jFHGhJplc,2233
16
16
  sentry_sdk/hub.py,sha256=2QLvEtIYSYV04r8h7VBmQjookILaiBZxZBGTtQKNAWg,25675
17
- sentry_sdk/logger.py,sha256=u_8zS8gjQt7FjYqz_I91sCbdsmBe7IgRqWxMP3vrsq0,2399
17
+ sentry_sdk/logger.py,sha256=HnmkMmOf1hwvxIcPW2qOvIOSnFZ9yRNDBae_eriGsoY,2471
18
18
  sentry_sdk/metrics.py,sha256=3IvBwbHlU-C-JdwDysTeJqOoVyYXsHZ7oEkkU0qTZb4,29913
19
19
  sentry_sdk/monitor.py,sha256=52CG1m2e8okFDVoTpbqfm9zeeaLa0ciC_r9x2RiXuDg,3639
20
20
  sentry_sdk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -74,7 +74,7 @@ sentry_sdk/integrations/huggingface_hub.py,sha256=ypTn17T0vufQwi7ODXONFkB8fMjUrU
74
74
  sentry_sdk/integrations/langchain.py,sha256=8ht-fXKb9muG3HEnKhuSvna2G8f2_M9BBzm1jXjnqiQ,26413
75
75
  sentry_sdk/integrations/launchdarkly.py,sha256=bvtExuj68xPXZFsQeWTDR-ZBqP087tPuVzP1bNAOZHc,1935
76
76
  sentry_sdk/integrations/litestar.py,sha256=jao0f8v5JQagkBg15dUJTdWGPxpS3LmOV301-lwGkGc,11815
77
- sentry_sdk/integrations/logging.py,sha256=3IvbPmvisv9ZM98SRRYlEH5g1nNVjOZz-204CWRcg-I,13641
77
+ sentry_sdk/integrations/logging.py,sha256=4JC2ehLqd5Tz_rad8YVb9KhZnPcDzLxLh-AjopyNVEc,13905
78
78
  sentry_sdk/integrations/loguru.py,sha256=fgivPdQn3rmsMeInUd2wbNlbXPAH9MKhjaqytRVKnsI,6215
79
79
  sentry_sdk/integrations/modules.py,sha256=vzLx3Erg77Vl4mnUvAgTg_3teAuWy7zylFpAidBI9I0,820
80
80
  sentry_sdk/integrations/openai.py,sha256=N3CSx8OJlcx6cK2bj8GjmtcjBsw4T3fHdqlMKAzXirc,22939
@@ -158,9 +158,9 @@ sentry_sdk/profiler/__init__.py,sha256=3PI3bHk9RSkkOXZKN84DDedk_7M65EiqqaIGo-DYs
158
158
  sentry_sdk/profiler/continuous_profiler.py,sha256=s0DHkj3RZYRg9HnQQC0G44ku6DaFqRy30fZTMtTYvIs,22828
159
159
  sentry_sdk/profiler/transaction_profiler.py,sha256=4Gj6FHLnK1di3GmnI1cCc_DbNcBVMdBjZZFvPvm7C7k,27877
160
160
  sentry_sdk/profiler/utils.py,sha256=G5s4tYai9ATJqcHrQ3bOIxlK6jIaHzELrDtU5k3N4HI,6556
161
- sentry_sdk-2.35.1.dist-info/licenses/LICENSE,sha256=KhQNZg9GKBL6KQvHQNBGMxJsXsRdhLebVp4Sew7t3Qs,1093
162
- sentry_sdk-2.35.1.dist-info/METADATA,sha256=aSyeMwy7g_kh0l6ZbIwJzcwGEKP2kxIX77QMBPMQHqQ,10278
163
- sentry_sdk-2.35.1.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
164
- sentry_sdk-2.35.1.dist-info/entry_points.txt,sha256=qacZEz40UspQZD1IukCXykx0JtImqGDOctS5KfOLTko,91
165
- sentry_sdk-2.35.1.dist-info/top_level.txt,sha256=XrQz30XE9FKXSY_yGLrd9bsv2Rk390GTDJOSujYaMxI,11
166
- sentry_sdk-2.35.1.dist-info/RECORD,,
161
+ sentry_sdk-2.35.2.dist-info/licenses/LICENSE,sha256=KhQNZg9GKBL6KQvHQNBGMxJsXsRdhLebVp4Sew7t3Qs,1093
162
+ sentry_sdk-2.35.2.dist-info/METADATA,sha256=FmXFlXAY2ea1whyuYCM_LCZMJIXm7V-2MNMkMxRZgXA,10278
163
+ sentry_sdk-2.35.2.dist-info/WHEEL,sha256=JNWh1Fm1UdwIQV075glCn4MVuCRs0sotJIq-J6rbxCU,109
164
+ sentry_sdk-2.35.2.dist-info/entry_points.txt,sha256=qacZEz40UspQZD1IukCXykx0JtImqGDOctS5KfOLTko,91
165
+ sentry_sdk-2.35.2.dist-info/top_level.txt,sha256=XrQz30XE9FKXSY_yGLrd9bsv2Rk390GTDJOSujYaMxI,11
166
+ sentry_sdk-2.35.2.dist-info/RECORD,,