Skip to content

Commit

Permalink
Zipkin Span tags will no longer be populated with Resource Attributes (
Browse files Browse the repository at this point in the history
…#1663)

* Remove Resource tag population

* Changelog updated

* Removing test case involving Resource

* removing local dictionary of tags, unused

* Making @CodeBlanch 's test changes thank you!

Co-authored-by: Cijo Thomas <[email protected]>
  • Loading branch information
Austin-Tan and cijothomas authored Jan 27, 2021
1 parent 842daff commit 9e9987a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
3 changes: 3 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
`True`/`False`.
([#1609](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1609))

* Span tags will no longer be populated with Resource Attributes.
([#1663](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1663))

## 1.0.0-rc1.1

Released 2020-Nov-17
Expand Down
19 changes: 4 additions & 15 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,13 @@ internal void SetLocalEndpointFromResource(Resource resource)
}

string serviceName = null;
Dictionary<string, object> tags = null;
foreach (var label in resource.Attributes)
{
string key = label.Key;

switch (key)
if (label.Key == ResourceSemanticConventions.AttributeServiceName)
{
case ResourceSemanticConventions.AttributeServiceName:
serviceName = label.Value as string;
continue;
serviceName = label.Value as string;
break;
}

if (tags == null)
{
tags = new Dictionary<string, object>();
}

tags[key] = label.Value;
}

if (string.IsNullOrEmpty(serviceName))
Expand All @@ -138,7 +127,7 @@ internal void SetLocalEndpointFromResource(Resource resource)
ipv4,
ipv6,
port: null,
tags);
tags: null);
}

private static string ResolveHostAddress(string hostName, AddressFamily family)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ public void IntegrationTest(
[ResourceSemanticConventions.AttributeServiceName] = serviceName,
["service.tag"] = "hello world",
}).Build());

resoureTags = "\"service.tag\":\"hello world\",";
}
else
{
Expand Down

0 comments on commit 9e9987a

Please sign in to comment.