debugbundle-python 1.1.0__py3-none-any.whl → 1.1.2__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.
- debugbundle/core.py +16 -4
- {debugbundle_python-1.1.0.dist-info → debugbundle_python-1.1.2.dist-info}/METADATA +1 -1
- {debugbundle_python-1.1.0.dist-info → debugbundle_python-1.1.2.dist-info}/RECORD +6 -6
- {debugbundle_python-1.1.0.dist-info → debugbundle_python-1.1.2.dist-info}/WHEEL +0 -0
- {debugbundle_python-1.1.0.dist-info → debugbundle_python-1.1.2.dist-info}/licenses/LICENSE +0 -0
- {debugbundle_python-1.1.0.dist-info → debugbundle_python-1.1.2.dist-info}/top_level.txt +0 -0
debugbundle/core.py
CHANGED
|
@@ -528,23 +528,27 @@ class DebugBundleSdk:
|
|
|
528
528
|
payload: dict[str, object],
|
|
529
529
|
context: Mapping[str, object] | None = None,
|
|
530
530
|
) -> dict[str, object]:
|
|
531
|
-
|
|
531
|
+
merged_context = self._merged_context(context)
|
|
532
|
+
event: dict[str, object] = {
|
|
532
533
|
"schema_version": SCHEMA_VERSION,
|
|
533
534
|
"event_id": str(uuid.uuid4()),
|
|
534
535
|
"event_type": event_type,
|
|
535
536
|
"occurred_at": _iso_now(self._time_provider),
|
|
536
537
|
"sdk_name": "debugbundle-python",
|
|
537
538
|
"sdk_version": _sdk_version(),
|
|
538
|
-
"sdk_language": "python",
|
|
539
539
|
"service": {
|
|
540
540
|
"name": self._service,
|
|
541
541
|
"runtime": "python",
|
|
542
542
|
"framework": None,
|
|
543
543
|
"environment": self._environment,
|
|
544
544
|
},
|
|
545
|
-
"correlation": _correlation_payload(
|
|
545
|
+
"correlation": _correlation_payload(merged_context),
|
|
546
546
|
"payload": payload,
|
|
547
547
|
}
|
|
548
|
+
envelope_context = _event_context(merged_context)
|
|
549
|
+
if envelope_context:
|
|
550
|
+
event["context"] = envelope_context
|
|
551
|
+
return event
|
|
548
552
|
|
|
549
553
|
def _merged_context(self, context: Mapping[str, object] | None = None) -> dict[str, object]:
|
|
550
554
|
merged = dict(self._context)
|
|
@@ -861,6 +865,14 @@ def _correlation_payload(context: Mapping[str, object]) -> dict[str, str | None]
|
|
|
861
865
|
}
|
|
862
866
|
|
|
863
867
|
|
|
868
|
+
def _event_context(context: Mapping[str, object]) -> dict[str, object]:
|
|
869
|
+
return {
|
|
870
|
+
str(key): value
|
|
871
|
+
for key, value in context.items()
|
|
872
|
+
if key not in {"request", "response", "correlation", "request_id", "trace_id", "session_id", "user_id_hash"}
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
|
|
864
876
|
def _coerce_optional_string(value: object) -> str | None:
|
|
865
877
|
if value is None:
|
|
866
878
|
return None
|
|
@@ -942,7 +954,7 @@ def _sdk_version() -> str:
|
|
|
942
954
|
try:
|
|
943
955
|
return metadata.version("debugbundle-python")
|
|
944
956
|
except metadata.PackageNotFoundError:
|
|
945
|
-
return "1.1.
|
|
957
|
+
return "1.1.2"
|
|
946
958
|
|
|
947
959
|
|
|
948
960
|
def _sdk_config_endpoint(events_endpoint: str) -> str:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
debugbundle/__init__.py,sha256=mqibduUrdcr_fnb6k3Gwf93H7iqVBS8zd6SceX-U3Q4,5011
|
|
2
2
|
debugbundle/config.py,sha256=ENRSR5jUI7xYdBqUakWws3GIjBk00GWFmwXVE_iQp2Y,9296
|
|
3
|
-
debugbundle/core.py,sha256=
|
|
3
|
+
debugbundle/core.py,sha256=wRzT4DmGRHkrsakbqHSr35b8O8yI2V9DIjEHMdqfhGo,37776
|
|
4
4
|
debugbundle/logger_integrations.py,sha256=RuTNaD9RRVmiE-BBkksAXWVEGaMzLrWavVpQdgGZBpE,4564
|
|
5
5
|
debugbundle/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
debugbundle/redaction.py,sha256=QTaPkSsYv54yR1mz8SB6Q4vWjvp7Ddcui4WXaH2RVz8,736
|
|
@@ -17,8 +17,8 @@ debugbundle/integrations/flask.py,sha256=cgyHbsAH96gpNPf_5IGJYzp2va28JdDgXROBsF-
|
|
|
17
17
|
debugbundle/integrations/relay_django.py,sha256=Wj8BE9D5otU2KmtjgqdKIJ-BvXVcagCKgpLYvnPZ6WE,2281
|
|
18
18
|
debugbundle/integrations/relay_fastapi.py,sha256=-Zl6bvhYMLii__mP6-UvSdwxS5VKsb9OZvk-yy-3hEw,2227
|
|
19
19
|
debugbundle/integrations/relay_flask.py,sha256=VFHkDTJy4LkZzL_Ry_Ba-e_gW6UTG4PBwnLcvB_oXuQ,2011
|
|
20
|
-
debugbundle_python-1.1.
|
|
21
|
-
debugbundle_python-1.1.
|
|
22
|
-
debugbundle_python-1.1.
|
|
23
|
-
debugbundle_python-1.1.
|
|
24
|
-
debugbundle_python-1.1.
|
|
20
|
+
debugbundle_python-1.1.2.dist-info/licenses/LICENSE,sha256=AKZZ5DQAHrOKGwt24VoRd-SXJLM9OloxlsX8ZgENdEY,735
|
|
21
|
+
debugbundle_python-1.1.2.dist-info/METADATA,sha256=j72wBHvKBxZZjjTkpcUrjVuLYza_T3Hcbi37hHBRFe8,13841
|
|
22
|
+
debugbundle_python-1.1.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
23
|
+
debugbundle_python-1.1.2.dist-info/top_level.txt,sha256=RCB9STTFnl1OKdojxz-xhaks2zkRFs1meZXsKnm18LM,12
|
|
24
|
+
debugbundle_python-1.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|