File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
packages/service-library/src/servicelib Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 2222from settings_library .tracing import TracingSettings
2323from yarl import URL
2424
25- from .. import tracing # noqa
26-
2725_logger = logging .getLogger (__name__ )
2826try :
2927 from opentelemetry .instrumentation .botocore import ( # type: ignore[import-not-found]
Original file line number Diff line number Diff line change 1919from settings_library .tracing import TracingSettings
2020from yarl import URL
2121
22- from .. import tracing # noqa
23-
2422_logger = logging .getLogger (__name__ )
2523
2624try :
@@ -72,7 +70,6 @@ def setup_tracing(
7270 ):
7371 _logger .warning ("Skipping opentelemetry tracing setup" )
7472 return
75-
7673 # Set up the tracer provider
7774 resource = Resource (attributes = {"service.name" : service_name })
7875 trace .set_tracer_provider (TracerProvider (resource = resource ))
Original file line number Diff line number Diff line change 33from opentelemetry import context as otcontext
44from opentelemetry import trace
55from opentelemetry .instrumentation .logging import LoggingInstrumentor
6-
7- LoggingInstrumentor ().instrument (set_logging_format = False )
6+ from settings_library .tracing import TracingSettings
87
98TracingContext : TypeAlias = otcontext .Context | None
109
@@ -27,3 +26,8 @@ def attach_context(context: TracingContext) -> None:
2726def detach_context (context : TracingContext ) -> None :
2827 if context is not None :
2928 otcontext .detach (context )
29+
30+
31+ def setup_log_tracing (tracing_settings : TracingSettings ):
32+ _ = tracing_settings
33+ LoggingInstrumentor ().instrument (set_logging_format = False )
You can’t perform that action at this time.
0 commit comments