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

Zipkin exporter: default service name #1777

Closed
MrAlias opened this issue Apr 6, 2021 · 3 comments
Closed

Zipkin exporter: default service name #1777

MrAlias opened this issue Apr 6, 2021 · 3 comments
Assignees
Labels
good first issue Good for newcomers pkg:exporter:zipkin Related to the Zipkin exporter package
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Apr 6, 2021

Currently in the exporter we default to "" if the resource doesn't contain a service name:

func getServiceName(attrs []attribute.KeyValue) string {
for _, kv := range attrs {
if kv.Key == semconv.ServiceNameKey {
return kv.Value.AsString()
}
}
// Resource holds a default value so this might not be reach.
return ""
}

The specification states:

If no service.name is contained in a Span's Resource, it MUST be populated from the default Resource.

While it is a good chance that the passed resource will be a merge with the default, it needs to explicitly be set to the default in the exporter.

@lastchiliarch
Copy link
Contributor

I'd like to take this.
Seems like we should use resource.Default() to get the default resource and then try to get the semconv.ServiceNameKey as the default service name.

@MrAlias
Copy link
Contributor Author

MrAlias commented Apr 7, 2021

Seems like we should use resource.Default() to get the default resource and then try to get the semconv.ServiceNameKey as the default service name.

Correct 👍

lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 8, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 8, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 8, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 8, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 8, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
lastchiliarch added a commit to lastchiliarch/opentelemetry-go that referenced this issue Apr 10, 2021
… name (open-telemetry#1777)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>
MrAlias added a commit that referenced this issue Apr 12, 2021
… name (#1777) (#1786)

Signed-off-by: lastchiliarch <lastchiliarch@163.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
@MrAlias
Copy link
Contributor Author

MrAlias commented Apr 27, 2021

Resolved by #1786

@MrAlias MrAlias closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers pkg:exporter:zipkin Related to the Zipkin exporter package
Projects
None yet
Development

No branches or pull requests

2 participants