diff --git a/opentelemetry-api/src/opentelemetry/util/types.py b/opentelemetry-api/src/opentelemetry/util/types.py index 3864b7cc76..3c3fdf9921 100644 --- a/opentelemetry-api/src/opentelemetry/util/types.py +++ b/opentelemetry-api/src/opentelemetry/util/types.py @@ -13,10 +13,21 @@ # limitations under the License. -from typing import Dict, List, Mapping, Optional, Sequence, Tuple, Union +from typing import Mapping, Optional, Sequence, Tuple, Union + +# This is the implementation of the "Any" type as specified by the specifications of OpenTelemetry data model for logs. +# For more details, refer to the OTel specification: +# https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#type-any AnyValue = Union[ - str, bool, int, float, bytes, List["AnyValue"], Dict[str, "AnyValue"], None + str, + bool, + int, + float, + bytes, + Sequence["AnyValue"], + Mapping[str, "AnyValue"], + None, ] AttributeValue = Union[ str,