Skip to content

Commit 250de89

Browse files
committed
add grpc exporter target switch for unix sockets
1 parent 0f54022 commit 250de89

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

exporters/otlp/src/otlp_grpc_client.cc

+6-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,12 @@ std::shared_ptr<grpc::Channel> OtlpGrpcClient::MakeChannel(const OtlpGrpcClientO
333333
}
334334

335335
std::shared_ptr<grpc::Channel> channel;
336-
std::string grpc_target = url.host_ + ":" + std::to_string(static_cast<int>(url.port_));
336+
std::string grpc_target;
337+
if (url.scheme_ == "unix") {
338+
grpc_target = "unix:" + url.path_;
339+
} else {
340+
grpc_target = url.host_ + ":" + std::to_string(static_cast<int>(url.port_));
341+
}
337342
grpc::ChannelArguments grpc_arguments;
338343
grpc_arguments.SetUserAgentPrefix(options.user_agent);
339344

0 commit comments

Comments
 (0)