otel-utils 0.2.0__py3-none-any.whl → 0.3.0__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 otel-utils might be problematic. Click here for more details.
otel_utils/configurator.py
CHANGED
|
@@ -134,9 +134,10 @@ class OtelConfigurator:
|
|
|
134
134
|
service_logger.removeHandler(handler)
|
|
135
135
|
|
|
136
136
|
for logger_name in logging.root.manager.loggerDict:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
logger.
|
|
137
|
+
if not logger_name.startswith(('uvicorn', 'fastapi')):
|
|
138
|
+
logger = logging.getLogger(logger_name)
|
|
139
|
+
for handler in logger.handlers[:]:
|
|
140
|
+
logger.removeHandler(handler)
|
|
140
141
|
|
|
141
142
|
logging.getLogger('opentelemetry').setLevel(logging.ERROR)
|
|
142
143
|
|
otel_utils/logging.py
CHANGED
|
@@ -23,8 +23,10 @@ class JsonFormatter(logging.Formatter):
|
|
|
23
23
|
|
|
24
24
|
if hasattr(record, "otelTraceID"):
|
|
25
25
|
log_record["trace_id"] = getattr(record, "otelTraceID")
|
|
26
|
+
log_record["dd.trace_id"] = getattr(record, "otelTraceID")
|
|
26
27
|
if hasattr(record, "otelSpanID"):
|
|
27
28
|
log_record["span_id"] = getattr(record, "otelSpanID")
|
|
29
|
+
log_record["dd.span_id"] = getattr(record, "otelSpanID")
|
|
28
30
|
|
|
29
31
|
for key, value in record.__dict__.items():
|
|
30
32
|
if key not in ignored_attrs and not key.startswith('_'):
|
|
@@ -111,7 +113,7 @@ class StructuredLogger:
|
|
|
111
113
|
self._log(logging.INFO, message, *args, **kwargs)
|
|
112
114
|
|
|
113
115
|
def warning(self, message: str, *args, **kwargs):
|
|
114
|
-
self._log(logging.
|
|
116
|
+
self._log(logging.WARNING, message, *args, **kwargs)
|
|
115
117
|
|
|
116
118
|
def error(self, message: str, *args, **kwargs):
|
|
117
119
|
self._log(logging.ERROR, message, *args, **kwargs)
|
|
@@ -147,4 +149,4 @@ class StructuredLogger:
|
|
|
147
149
|
error=str(e),
|
|
148
150
|
**context
|
|
149
151
|
)
|
|
150
|
-
raise
|
|
152
|
+
raise e
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
otel_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
otel_utils/configurator.py,sha256=WTA3cjpva0pXJL5PdOhygiODbqmWWhVIgLqL1leupcA,7525
|
|
3
|
+
otel_utils/logging.py,sha256=_xmTNhEuamRxDie1FRheNXmIpSxa5TBjeeoEbFvAq8Y,4953
|
|
4
|
+
otel_utils/metrics.py,sha256=XD-t9V3peZJs97hN2hR2rwJKrcCJHqx2cldNOTCpzoA,3664
|
|
5
|
+
otel_utils/tracing.py,sha256=PtowQ7MvYld_xJlVAV4pBQuDBQIqPeP1FQPrzgZx9_Q,2625
|
|
6
|
+
otel_utils-0.3.0.dist-info/METADATA,sha256=HXBLAGsHu0TNerhBi457hG4UH9G-2JLndOiSLsD1300,5278
|
|
7
|
+
otel_utils-0.3.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
8
|
+
otel_utils-0.3.0.dist-info/RECORD,,
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
otel_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
otel_utils/configurator.py,sha256=hLNxGoUOXRxL62wg00W1ArRiGIJR28iRQL7S4UXaajw,7446
|
|
3
|
-
otel_utils/logging.py,sha256=4Lpg2-GXwVbRhUsxCsJkKKCitEA5O0V3-Qa3NvtJ9vk,4808
|
|
4
|
-
otel_utils/metrics.py,sha256=XD-t9V3peZJs97hN2hR2rwJKrcCJHqx2cldNOTCpzoA,3664
|
|
5
|
-
otel_utils/tracing.py,sha256=PtowQ7MvYld_xJlVAV4pBQuDBQIqPeP1FQPrzgZx9_Q,2625
|
|
6
|
-
otel_utils-0.2.0.dist-info/METADATA,sha256=nmmGm3Ra8tnhzzm50taTNWHHBw-g5Ys9a-U7U0w9jR0,5278
|
|
7
|
-
otel_utils-0.2.0.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
|
|
8
|
-
otel_utils-0.2.0.dist-info/RECORD,,
|
|
File without changes
|