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

feat(exporter-zipkin): per-span service name #1789

Merged
11 changes: 6 additions & 5 deletions packages/opentelemetry-exporter-zipkin/src/zipkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ export class ZipkinExporter implements SpanExporter {
resultCallback: (result: ExportResult) => void
) {
if (typeof this._serviceName !== 'string') {
this._serviceName = String(
spans[0].resource.attributes[SERVICE_RESOURCE.NAME] ||
this.DEFAULT_SERVICE_NAME
);
this._serviceName = this.DEFAULT_SERVICE_NAME;
}
this._logger.debug('Zipkin exporter export');
if (this._isShutdown) {
Expand Down Expand Up @@ -109,7 +106,11 @@ export class ZipkinExporter implements SpanExporter {
const zipkinSpans = spans.map(span =>
toZipkinSpan(
span,
serviceName,
String(
span.attributes[SERVICE_RESOURCE.NAME] ||
span.resource.attributes[SERVICE_RESOURCE.NAME] ||
serviceName
),
this._statusCodeTagName,
this._statusDescriptionTagName
)
Expand Down