warpzone-sdk 15.0.0.dev9__py3-none-any.whl → 15.0.0.dev10__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.
@@ -15,6 +15,16 @@ SUBJECT_IDENTIFIER = "<Subject>"
15
15
 
16
16
  @contextmanager
17
17
  def run_in_trace_context(context: func.Context):
18
+ """Set up trace context and ensure log correlation for this function invocation.
19
+
20
+ This sets:
21
+ 1. OpenTelemetry trace context (for distributed tracing via Service Bus)
22
+ 2. Azure Functions invocation_id in thread-local storage (for log correlation)
23
+ """
24
+ # Ensure Azure Functions' log correlation uses this invocation's ID
25
+ # This prevents log leakage when multiple functions run concurrently
26
+ context.thread_local_storage.invocation_id = context.invocation_id
27
+
18
28
  trace_context = context.trace_context
19
29
  with traces.set_trace_context(
20
30
  trace_context.trace_parent, trace_context.trace_state
warpzone/monitor/logs.py CHANGED
@@ -19,9 +19,8 @@ logging.getLogger("azure.monitor.opentelemetry.exporter").setLevel(logging.WARNI
19
19
  def get_logger(name: str):
20
20
  """Get a logger instance.
21
21
 
22
- The logger will automatically use the current OpenTelemetry trace context
23
- for correlation in Application Insights. The trace context is set by the
24
- monitor decorator's run_in_trace_context context manager.
22
+ Logs are correlated with the correct function invocation via Azure Functions'
23
+ thread-local storage invocation_id, which is set by the monitor decorator.
25
24
 
26
25
  Args:
27
26
  name: Logger name, typically __name__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: warpzone-sdk
3
- Version: 15.0.0.dev9
3
+ Version: 15.0.0.dev10
4
4
  Summary: The main objective of this package is to centralize logic used to interact with Azure Functions, Azure Service Bus and Azure Table Storage
5
5
  Author: Team Enigma
6
6
  Author-email: enigma@energinet.dk
@@ -17,7 +17,7 @@ warpzone/function/__init__.py,sha256=rJOZBpWsUgjMc7YtXMJ1rLGm45KB1AhDJ_Y2ISiSISc
17
17
  warpzone/function/checks.py,sha256=B9YqThymf16ac_fVAYKilv20ru5v9nwXgHlbxYIaG98,1018
18
18
  warpzone/function/functionize.py,sha256=bSV0QvwKbD9Vo3a_8cc1rgV2rzTdMMvidinyXItBfvs,2128
19
19
  warpzone/function/integrations.py,sha256=sDt2BTx6a4mVc-33wTITP9XQVPustwj7rkX4urTyOqo,4018
20
- warpzone/function/monitor.py,sha256=b_oc1090quhouUahmFin08XMgPNRnSQf0uGNRL08Qg0,1579
20
+ warpzone/function/monitor.py,sha256=7GySRig9mI-BtGHm_l5anhmICNjOybgR3MrVhht1ZY8,2065
21
21
  warpzone/function/process.py,sha256=nbUVywM8ChfUwuaqFisgaD98aNRgeZkK4g5sbtuBdRs,2339
22
22
  warpzone/function/processors/__init__.py,sha256=DhIdSWLBcIeSO8IJdxPqGIhgwwnkDN6_Xqwy93BCLeA,46
23
23
  warpzone/function/processors/dependencies.py,sha256=m17BwdKyQEvzCPxpQZpAW5l1uYRIHWmweDz3XJskmpA,1259
@@ -28,7 +28,7 @@ warpzone/function/types.py,sha256=5m2hRrnLC3eqIlAH5-MM9_wKjMZ6lYawZtCOVStyFuY,72
28
28
  warpzone/healthchecks/__init__.py,sha256=9gc_Mt2szs8sDSwy0V4l3JZ6d9hX41xTpZCkDP2qsY4,2108
29
29
  warpzone/healthchecks/model.py,sha256=mM7DnrirLbUpBPPfi82MUPP654D0eOR2_F65TmzsPD0,1187
30
30
  warpzone/monitor/__init__.py,sha256=ggI5fIUu-szgC44ICzuOmpYrIoVOKPbsMT3zza9ssD4,87
31
- warpzone/monitor/logs.py,sha256=fabjaB5SfHynvvfp2Js3IG-owqU5jZ3lTnnmTTjD6JM,1320
31
+ warpzone/monitor/logs.py,sha256=4TSf5zjkLL1L6SehVxya7mjF54E3hhlnmFSB5Sk1DEc,1264
32
32
  warpzone/monitor/traces.py,sha256=GNDo8-EwiV1VgS8b60JVKz0MILC1K9buGS1AguZHcPY,4613
33
33
  warpzone/servicebus/data/__init__.py,sha256=lnc0uiaGLF0qMi_rWhCpRSFvaj0CJEiMCAl6Yqn1ZiA,21
34
34
  warpzone/servicebus/data/client.py,sha256=zECS3JwedhYnDk8PntYgIYpBF_uu9YN38KzpPFK7CKs,6511
@@ -52,6 +52,6 @@ warpzone/tools/copy.py,sha256=5fddotMZkXZO8avzUbGOhvs0cp8mce95pNpy0oPVjnQ,2596
52
52
  warpzone/transform/__init__.py,sha256=ruGa7tl-v4ndlWpULE1jSGU_a4_iRc3V6eyNr5xKP9E,27
53
53
  warpzone/transform/data.py,sha256=Abb8PcrgMbbNCJkkIUdtrTHdlY0OfXid387qw1nDpFY,2362
54
54
  warpzone/transform/schema.py,sha256=nbSQtDMvXkyqGKuwhuFCF0WsEDsaNyoPYpMKvbsKlv8,2423
55
- warpzone_sdk-15.0.0.dev9.dist-info/METADATA,sha256=onn-qM-yNQeBLXK5hMVZUWosCvR0l8Lqw4gUknoZiaI,7398
56
- warpzone_sdk-15.0.0.dev9.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
57
- warpzone_sdk-15.0.0.dev9.dist-info/RECORD,,
55
+ warpzone_sdk-15.0.0.dev10.dist-info/METADATA,sha256=ZkvvLVc9pluIMkBrCfkiEVw91YXE2_hFsrq0lF4C0YU,7399
56
+ warpzone_sdk-15.0.0.dev10.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
57
+ warpzone_sdk-15.0.0.dev10.dist-info/RECORD,,