File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Sources/Exporters/Zipkin/Implementation Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ struct ZipkinConversionExtension {
2121 static var localEndpointCache = [ String: ZipkinEndpoint] ( )
2222 static var remoteEndpointCache = [ String: ZipkinEndpoint] ( )
2323
24+ static let defaultServiceName = " unknown_service: " + ProcessInfo. processInfo. processName
25+
2426 struct AttributeEnumerationState {
2527 var tags = [ String: String] ( )
2628 var RemoteEndpointServiceName : String ?
@@ -44,10 +46,12 @@ struct ZipkinConversionExtension {
4446
4547 var localEndpoint = defaultLocalEndpoint
4648
47- if let serviceName = attributeEnumerationState. serviceName, !serviceName. isEmpty {
49+ if let serviceName = attributeEnumerationState. serviceName, !serviceName. isEmpty && !defaultServiceName . elementsEqual ( serviceName ) {
4850 if localEndpointCache [ serviceName] == nil {
4951 localEndpoint = defaultLocalEndpoint. clone ( serviceName: serviceName)
5052 localEndpointCache [ serviceName] = localEndpoint
53+ } else {
54+ localEndpoint = localEndpointCache [ serviceName]
5155 }
5256 }
5357
You can’t perform that action at this time.
0 commit comments