From 6a4595e50a13b47f3d38c7dee76779a1f0ebc3fe Mon Sep 17 00:00:00 2001 From: Vivek Date: Thu, 4 Jul 2024 10:47:37 +0530 Subject: [PATCH] Replace default dict with custom Attributes object --- .../src/opentelemetry/sdk/util/instrumentation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opentelemetry-sdk/src/opentelemetry/sdk/util/instrumentation.py b/opentelemetry-sdk/src/opentelemetry/sdk/util/instrumentation.py index 47cef7a628c..a292ded0365 100644 --- a/opentelemetry-sdk/src/opentelemetry/sdk/util/instrumentation.py +++ b/opentelemetry-sdk/src/opentelemetry/sdk/util/instrumentation.py @@ -17,6 +17,7 @@ from deprecated import deprecated from opentelemetry.attributes import BoundedAttributes +from opentelemetry.util.types import Attributes class InstrumentationInfo: @@ -91,7 +92,7 @@ def __init__( name: str, version: Optional[str] = None, schema_url: Optional[str] = None, - attributes: Optional[dict] = None, + attributes: Optional[Attributes] = None, ) -> None: self._name = name self._version = version @@ -149,7 +150,7 @@ def name(self) -> str: return self._name @property - def attributes(self) -> Optional[dict]: + def attributes(self) -> Optional[Attributes]: return self._attributes def to_json(self, indent=4) -> str: