sdk: rename resource labels to attributes (#1082)

This aligns with the specification for Resources
This commit is contained in:
alrex 2020-09-09 08:23:18 -07:00 committed by alrex
parent a36558946c
commit 326d77aa7d
2 changed files with 3 additions and 3 deletions

View File

@ -211,7 +211,7 @@ def _extract_tags_from_dict(tags_dict):
def _extract_tags_from_span(span: Span):
tags = _extract_tags_from_dict(getattr(span, "attributes", None))
if span.resource:
tags.update(_extract_tags_from_dict(span.resource.labels))
tags.update(_extract_tags_from_dict(span.resource.attributes))
return tags

View File

@ -177,14 +177,14 @@ class TestZipkinSpanExporter(unittest.TestCase):
otel_spans[1].start(start_time=start_times[1])
otel_spans[1].resource = Resource(
labels={"key_resource": "some_resource"}
attributes={"key_resource": "some_resource"}
)
otel_spans[1].end(end_time=end_times[1])
otel_spans[2].start(start_time=start_times[2])
otel_spans[2].set_attribute("key_string", "hello_world")
otel_spans[2].resource = Resource(
labels={"key_resource": "some_resource"}
attributes={"key_resource": "some_resource"}
)
otel_spans[2].end(end_time=end_times[2])