diff --git a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md index 0bad17af44c..8b6931dad03 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md +++ b/src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md @@ -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 diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs index 98ea5aed566..06f70c3c9eb 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs @@ -108,24 +108,13 @@ internal void SetLocalEndpointFromResource(Resource resource) } string serviceName = null; - Dictionary 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(); - } - - tags[key] = label.Value; } if (string.IsNullOrEmpty(serviceName)) @@ -138,7 +127,7 @@ internal void SetLocalEndpointFromResource(Resource resource) ipv4, ipv6, port: null, - tags); + tags: null); } private static string ResolveHostAddress(string hostName, AddressFamily family) diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs index 6c620cb4cb4..24e5bb99f6e 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs @@ -183,8 +183,6 @@ public void IntegrationTest( [ResourceSemanticConventions.AttributeServiceName] = serviceName, ["service.tag"] = "hello world", }).Build()); - - resoureTags = "\"service.tag\":\"hello world\","; } else {