Skip to content

Commit 32ed6a7

Browse files
authored
upgrade OTel python to 0.17b0, small fixes (#101)
* upgrade OTel python to 0.17b0, small fixes * allow "OpenTelemetry Authors"
1 parent 0ae0685 commit 32ed6a7

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

.github/header-checker-lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
allowedLicenses:
22
- Apache-2.0
3+
allowedCopyrightHolders:
4+
- Google
5+
- OpenTelemetry Authors
36
sourceFileExtensions:
47
- py
58
- sh

dev-constraints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ Sphinx==3.1.2
1010
# development before GA. After GA, we will build against specific releases.
1111
# Bump the commit frequently during development whenever you are missing
1212
# changes from upstream.
13-
opentelemetry-api~=0.16b1
14-
opentelemetry-sdk~=0.16b1
13+
opentelemetry-api~=0.17b0
14+
opentelemetry-sdk~=0.17b0

opentelemetry-exporter-google-cloud/src/opentelemetry/exporter/cloud_trace/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,9 @@ def _extract_attributes(
388388
add_agent_attr: bool = False,
389389
) -> ProtoSpan.Attributes:
390390
"""Convert span.attributes to dict."""
391-
attributes_dict = BoundedDict(num_attrs_limit)
391+
attributes_dict = BoundedDict(
392+
num_attrs_limit
393+
) # type: BoundedDict[str, AttributeValue]
392394
invalid_value_dropped_count = 0
393395
for key, value in attrs.items() if attrs else []:
394396
key = _truncate_str(key, 128)[0]
@@ -411,7 +413,7 @@ def _extract_attributes(
411413
)
412414
return ProtoSpan.Attributes(
413415
attribute_map=attributes_dict,
414-
dropped_attributes_count=attributes_dict.dropped
416+
dropped_attributes_count=attributes_dict.dropped # type: ignore[attr-defined]
415417
+ invalid_value_dropped_count,
416418
)
417419

opentelemetry-tools-google-cloud/src/opentelemetry/tools/cloud_trace_propagator.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
_TRACE_CONTEXT_HEADER_NAME = "X-Cloud-Trace-Context"
2929
_TRACE_CONTEXT_HEADER_FORMAT = r"(?P<trace_id>[0-9a-f]{32})\/(?P<span_id>[\d]{1,20});o=(?P<trace_flags>\d+)"
3030
_TRACE_CONTEXT_HEADER_RE = re.compile(_TRACE_CONTEXT_HEADER_FORMAT)
31+
_FIELDS = {_TRACE_CONTEXT_HEADER_NAME}
3132

3233

3334
class CloudTraceFormatPropagator(textmap.TextMapPropagator):
@@ -85,3 +86,7 @@ def inject(
8586
int(span_context.trace_flags.sampled),
8687
)
8788
set_in_carrier(carrier, _TRACE_CONTEXT_HEADER_NAME, header)
89+
90+
@property
91+
def fields(self) -> typing.Set[str]:
92+
return _FIELDS

0 commit comments

Comments
 (0)