bdd-trace 0.4.1__py3-none-any.whl → 0.5.1__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.
bdd_trace/log.py
CHANGED
@@ -17,6 +17,7 @@ def setup_logging(
|
|
17
17
|
level: str | int = INFO,
|
18
18
|
trace_id_format: str = "%(asctime)s|%(levelname)s|%(name)s|%(otelTraceID)s|%(message)s",
|
19
19
|
no_trace_id_format: str = "%(asctime)s|%(levelname)s|%(name)s|%(message)s",
|
20
|
+
extra_handlers: list[Handler] | None = None,
|
20
21
|
) -> None:
|
21
22
|
global _log_queue, _log_listener
|
22
23
|
if _log_queue is not None or _log_listener is not None:
|
@@ -29,9 +30,10 @@ def setup_logging(
|
|
29
30
|
for module in modules:
|
30
31
|
_setup_module_logger(level, module)
|
31
32
|
|
33
|
+
log_process_handlers = extra_handlers or []
|
32
34
|
format = trace_id_format if profile != Profile.NO_TRACE else no_trace_id_format
|
33
35
|
console_handler = _create_console_handler(modules, format)
|
34
|
-
log_process_handlers
|
36
|
+
log_process_handlers.append(console_handler)
|
35
37
|
if profile != Profile.NO_TRACE:
|
36
38
|
otel_handler = LoggingHandler()
|
37
39
|
log_process_handlers.append(otel_handler)
|
bdd_trace/trace.py
CHANGED
@@ -20,6 +20,7 @@ _EXPORTER_OTLP_INSECURE_KEY = "exporter_otlp_insecure"
|
|
20
20
|
_SERVICE_NAME_KEY = "service_name"
|
21
21
|
_PYTHON_FASTAPI_EXCLUDE_URLS_KEY = "python_fastapi_excluded_urls"
|
22
22
|
_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST_KEY = "instrumentation_http_capture_headers_server_request"
|
23
|
+
_OTEL_PYTHON_LOG_CORRELATION_KEY = "otel_python_log_correlation"
|
23
24
|
|
24
25
|
_default_envs = {
|
25
26
|
_TRACES_EXPORTER_KEY: "otlp",
|
@@ -28,6 +29,7 @@ _default_envs = {
|
|
28
29
|
_PYTHON_FASTAPI_EXCLUDE_URLS_KEY: "/healthCheck",
|
29
30
|
_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST_KEY: "X-User-Id,X-Conversation-From",
|
30
31
|
_EXPORTER_OTLP_INSECURE_KEY: "true",
|
32
|
+
_OTEL_PYTHON_LOG_CORRELATION_KEY: "true",
|
31
33
|
}
|
32
34
|
|
33
35
|
_profile_config = {
|
@@ -0,0 +1,7 @@
|
|
1
|
+
bdd_trace/__init__.py,sha256=X4Nx6VppPfXXXEe5oC_foryalbOk5f9HLOi50Nat8mY,154
|
2
|
+
bdd_trace/log.py,sha256=Solf9XJTnfgEtvQidTQadoQ7MBHuPSrpPBCUt6X1Dro,2846
|
3
|
+
bdd_trace/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
bdd_trace/trace.py,sha256=-87IAk0b063uMWO9n4_1lUne9XLsJjnAh5mQaCD4sWc,3340
|
5
|
+
bdd_trace-0.5.1.dist-info/WHEEL,sha256=Jb20R3Ili4n9P1fcwuLup21eQ5r9WXhs4_qy7VTrgPI,79
|
6
|
+
bdd_trace-0.5.1.dist-info/METADATA,sha256=8ZRvNlPsg_crcxOR-SS0D1eG4tGpmcqVuakVaqFLmNA,1585
|
7
|
+
bdd_trace-0.5.1.dist-info/RECORD,,
|
bdd_trace-0.4.1.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
bdd_trace/__init__.py,sha256=X4Nx6VppPfXXXEe5oC_foryalbOk5f9HLOi50Nat8mY,154
|
2
|
-
bdd_trace/log.py,sha256=dCxXu9qoPeInqgZw6ElumDmc4B_QX5KultLlZ5edfns,2745
|
3
|
-
bdd_trace/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
bdd_trace/trace.py,sha256=ovXyQkKQVzhMjScIxAMi55UG7lZUYn6ipwY6nN_W0AM,3229
|
5
|
-
bdd_trace-0.4.1.dist-info/WHEEL,sha256=Jb20R3Ili4n9P1fcwuLup21eQ5r9WXhs4_qy7VTrgPI,79
|
6
|
-
bdd_trace-0.4.1.dist-info/METADATA,sha256=0W8Yh05xaCMEOCtIp0FArslo_hDU7vvQuHFJ2W-1eLI,1585
|
7
|
-
bdd_trace-0.4.1.dist-info/RECORD,,
|
File without changes
|