diff --git a/translation-stackdriver/src/main/java/zipkin2/translation/stackdriver/AttributesExtractor.java b/translation-stackdriver/src/main/java/zipkin2/translation/stackdriver/AttributesExtractor.java index e7a795b9..5edbbd0d 100644 --- a/translation-stackdriver/src/main/java/zipkin2/translation/stackdriver/AttributesExtractor.java +++ b/translation-stackdriver/src/main/java/zipkin2/translation/stackdriver/AttributesExtractor.java @@ -80,7 +80,9 @@ Attributes extract(Span zipkinSpan) { } } - if (zipkinSpan.localEndpoint() != null && !zipkinSpan.localEndpoint().serviceName().isEmpty()) { + if (zipkinSpan.localEndpoint() != null && + zipkinSpan.localEndpoint().serviceName() != null && + !zipkinSpan.localEndpoint().serviceName().isEmpty()) { attributes.putAttributeMap( kComponentLabelKey, toAttributeValue(zipkinSpan.localEndpoint().serviceName())); }