Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding service.namespace as tags for zipkin #1521

Merged
merged 2 commits into from
Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/OpenTelemetry.Exporter.Zipkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

* Zipkin tags used for InstrumentationLibrary changed from library.name,
library.version to otel.library.name, otel.library.version respectively.
* Sending `service.namespace` as Zipkin tag.
([#1521](https://github.com/open-telemetry/opentelemetry-dotnet/pull/1521))

## 0.8.0-beta.1

Expand Down
12 changes: 1 addition & 11 deletions src/OpenTelemetry.Exporter.Zipkin/ZipkinExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ internal void SetLocalEndpointFromResource(Resource resource)
}

string serviceName = null;
string serviceNamespace = null;
Dictionary<string, object> tags = null;
foreach (var label in resource.Attributes)
{
Expand All @@ -119,9 +118,6 @@ internal void SetLocalEndpointFromResource(Resource resource)
case Resource.ServiceNameKey:
serviceName = label.Value as string;
continue;
case Resource.ServiceNamespaceKey:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddynaka FYI same logic exists in JaegerExporter.

serviceNamespace = label.Value as string;
continue;
}

if (tags == null)
Expand All @@ -132,13 +128,7 @@ internal void SetLocalEndpointFromResource(Resource resource)
tags[key] = label.Value;
}

if (!string.IsNullOrEmpty(serviceName))
{
serviceName = serviceNamespace != null
? serviceNamespace + "." + serviceName
: serviceName;
}
else
if (string.IsNullOrEmpty(serviceName))
{
serviceName = this.options.ServiceName;
}
Expand Down