diff --git a/adbpyg_adapter/adapter.py b/adbpyg_adapter/adapter.py index a392521..4d0a0f6 100644 --- a/adbpyg_adapter/adapter.py +++ b/adbpyg_adapter/adapter.py @@ -41,7 +41,7 @@ ) if TRACING_ENABLED: - from opentelemetry import trace + from opentelemetry.trace import Tracer class ADBPyG_Adapter(Abstract_ADBPyG_Adapter): @@ -69,7 +69,7 @@ def __init__( db: StandardDatabase, controller: ADBPyG_Controller = ADBPyG_Controller(), logging_lvl: Union[str, int] = logging.INFO, - tracer: Optional["trace.Tracer"] = None, + tracer: Optional["Tracer"] = None, ): self.set_logging(logging_lvl) self.set_tracer(tracer) @@ -104,11 +104,13 @@ def set_logging(self, level: Union[int, str]) -> None: """ logger.setLevel(level) - def set_tracer(self, tracer: Optional["trace.Tracer"]) -> None: + def set_tracer(self, tracer: Optional["Tracer"]) -> None: """Set the OpenTelemetry tracer for the adapter instance. Requires the `tracing` extra to be installed (i.e `pip install adbpyg-adapter[tracing]`). - :param tracer: The OpenTelemetry tracer instance. + :param tracer: The OpenTelemetry tracer instance. See + `adbpyg_adapter.tracing.create_tracer` for details on how to + create a tracer instance. :type tracer: opentelemetry.trace.Tracer :raise ImportError: If OpenTelemetry is not installed. """