Skip to content

Commit a4d5707

Browse files
committed
Replace deprecated BoundedDict with BoundedAttributes and bump minimum version requirement for opentelemetry-api to 1.4 for opentelemetry-exporter-gcp-trace
1 parent a190a12 commit a4d5707

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opentelemetry-exporter-gcp-trace/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ package_dir=
2626
packages=find_namespace:
2727
install_requires =
2828
google-cloud-trace ~= 1.1
29-
opentelemetry-api ~= 1.0
29+
opentelemetry-api ~= 1.4
3030
opentelemetry-sdk ~= 1.0
3131
opentelemetry-resourcedetector-gcp >= 1.5.0dev0, == 1.*
3232

opentelemetry-exporter-gcp-trace/src/opentelemetry/exporter/cloud_trace/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@
9797
Timestamp,
9898
)
9999
from google.rpc import code_pb2, status_pb2
100+
from opentelemetry.attributes import BoundedAttributes
100101
from opentelemetry.exporter.cloud_trace.environment_variables import (
101102
OTEL_EXPORTER_GCP_TRACE_PROJECT_ID,
102103
OTEL_EXPORTER_GCP_TRACE_RESOURCE_REGEX,
@@ -115,7 +116,6 @@
115116
SpanExporter,
116117
SpanExportResult,
117118
)
118-
from opentelemetry.sdk.util import BoundedDict
119119
from opentelemetry.trace import format_span_id, format_trace_id
120120
from opentelemetry.trace.status import StatusCode
121121
from opentelemetry.util import types
@@ -476,9 +476,9 @@ def _extract_attributes(
476476
add_agent_attr: bool = False,
477477
) -> trace_types.Span.Attributes:
478478
"""Convert span.attributes to dict."""
479-
attributes_dict: BoundedDict[
479+
attributes_dict: BoundedAttributes[
480480
str, trace_types.AttributeValue
481-
] = BoundedDict(num_attrs_limit)
481+
] = BoundedAttributes(num_attrs_limit)
482482
invalid_value_dropped_count = 0
483483
for ot_key, ot_value in attrs.items() if attrs else []:
484484
key = _truncate_str(ot_key, MAX_ATTR_KEY_BYTES)[0]

0 commit comments

Comments
 (0)