Skip to content
11 changes: 10 additions & 1 deletion exporters/otlp/src/otlp_grpc_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,16 @@ std::shared_ptr<grpc::Channel> OtlpGrpcClient::MakeChannel(const OtlpGrpcClientO
}

std::shared_ptr<grpc::Channel> channel;
std::string grpc_target = url.host_ + ":" + std::to_string(static_cast<int>(url.port_));
std::string grpc_target;

if (url.scheme_ == "unix")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test for unix socket?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add some example on the unix scheme in the comment to help understanding?

{
grpc_target = "unix:" + url.path_;
}
else
{
grpc_target = url.host_ + ":" + std::to_string(static_cast<int>(url.port_));
}
grpc::ChannelArguments grpc_arguments;
grpc_arguments.SetUserAgentPrefix(options.user_agent);

Expand Down
Loading