blaxel 0.1.18rc64__py3-none-any.whl → 0.1.18rc65__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.
- blaxel/common/logger.py +11 -8
- {blaxel-0.1.18rc64.dist-info → blaxel-0.1.18rc65.dist-info}/METADATA +1 -1
- {blaxel-0.1.18rc64.dist-info → blaxel-0.1.18rc65.dist-info}/RECORD +5 -5
- {blaxel-0.1.18rc64.dist-info → blaxel-0.1.18rc65.dist-info}/WHEEL +0 -0
- {blaxel-0.1.18rc64.dist-info → blaxel-0.1.18rc65.dist-info}/licenses/LICENSE +0 -0
blaxel/common/logger.py
CHANGED
@@ -6,8 +6,7 @@ import json
|
|
6
6
|
import logging
|
7
7
|
import os
|
8
8
|
|
9
|
-
from opentelemetry import
|
10
|
-
from opentelemetry import context as context_api
|
9
|
+
from opentelemetry.trace import get_current_span
|
11
10
|
|
12
11
|
|
13
12
|
class JsonFormatter(logging.Formatter):
|
@@ -36,14 +35,18 @@ class JsonFormatter(logging.Formatter):
|
|
36
35
|
self.labels_name: {}
|
37
36
|
}
|
38
37
|
|
39
|
-
#
|
40
|
-
|
41
|
-
current_span = trace.get_current_span()
|
38
|
+
# Get current active span - equivalent to trace.getActiveSpan() in JS
|
39
|
+
current_span = get_current_span()
|
42
40
|
|
43
|
-
if
|
41
|
+
# Check if span exists and has valid context (equivalent to 'if (currentSpan)' in JS)
|
42
|
+
if current_span and current_span.get_span_context().is_valid:
|
44
43
|
span_context = current_span.get_span_context()
|
45
|
-
|
46
|
-
|
44
|
+
# Format trace_id and span_id as hex strings (like JS does)
|
45
|
+
trace_id_hex = format(span_context.trace_id, '032x')
|
46
|
+
span_id_hex = format(span_context.span_id, '016x')
|
47
|
+
|
48
|
+
log_entry[self.trace_id_name] = f"{self.trace_id_prefix}{trace_id_hex}"
|
49
|
+
log_entry[self.span_id_name] = f"{self.span_id_prefix}{span_id_hex}"
|
47
50
|
|
48
51
|
# Add task ID if available
|
49
52
|
task_id = os.environ.get(self.task_index)
|
@@ -285,7 +285,7 @@ blaxel/client/models/workspace_user.py,sha256=70CcifQWYbeWG7TDui4pblTzUe5sVK0AS1
|
|
285
285
|
blaxel/common/autoload.py,sha256=NFuK71-IHOY2JQyEBSjDCVfUaQ8D8PJsEUEryIdG4AU,263
|
286
286
|
blaxel/common/env.py,sha256=wTbzPDdNgz4HMJiS2NCZmQlN0qpxy1PQEYBaZgtvhoc,1247
|
287
287
|
blaxel/common/internal.py,sha256=6lZENUQrh3bvpMIPLaie6-g2upiNzf21QG-dQ0hGJWU,2371
|
288
|
-
blaxel/common/logger.py,sha256=
|
288
|
+
blaxel/common/logger.py,sha256=TNuWqwFDU87TwPDHLLDTluwgEyw2axj-d0kPOkN5J8M,4489
|
289
289
|
blaxel/common/settings.py,sha256=7KTryuBdud0IfHqykX7xEEtpgq5M5h1Z8YEzYKsHB-Q,2327
|
290
290
|
blaxel/instrumentation/exporters.py,sha256=EoX3uaBVku1Rg49pSNXKFyHhgY5OV3Ih6UlqgjF5epw,1670
|
291
291
|
blaxel/instrumentation/log.py,sha256=RvQByRjZMoP_dRaAZu8oK6DTegsHs-xV4W-UIqis6CA,2461
|
@@ -364,7 +364,7 @@ blaxel/tools/llamaindex.py,sha256=-gQ-C9V_h9a11J4ItsbWjXrCJOg0lRKsb98v9rVsNak,71
|
|
364
364
|
blaxel/tools/openai.py,sha256=GuFXkj6bXEwldyVr89jEsRAi5ihZUVEVe327QuWiGNs,653
|
365
365
|
blaxel/tools/pydantic.py,sha256=CvnNbAG_J4yBtA-XFI4lQrq3FYKjNd39hu841vZT004,1801
|
366
366
|
blaxel/tools/types.py,sha256=YPCGJ4vZDhqR0X2H_TWtc5chQScsC32nGTQdRKJlO8Y,707
|
367
|
-
blaxel-0.1.
|
368
|
-
blaxel-0.1.
|
369
|
-
blaxel-0.1.
|
370
|
-
blaxel-0.1.
|
367
|
+
blaxel-0.1.18rc65.dist-info/METADATA,sha256=ddggGZuNM7FiX7SPdRJ_SSXvSGP7HzfGy9F4dgCPDLg,6706
|
368
|
+
blaxel-0.1.18rc65.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
369
|
+
blaxel-0.1.18rc65.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
|
370
|
+
blaxel-0.1.18rc65.dist-info/RECORD,,
|
File without changes
|
File without changes
|