You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unable to use grpc exporter in BlazorWasm with current OpenTelemetry grpc exporter code. Currently GrpcChannel is created with default GrpcChannelOptions which default ot using SocketsHttpHandler and invoke load balancing code which ends up crashing.
Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.IsSocketsHttpHandlerSetup(SocketsHttpHandler socketsHttpHandler)
at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.ConfigureSocketsHttpHandlerSetup(SocketsHttpHandler socketsHttpHandler, Func`3 connectCallback)
at Grpc.Net.Client.GrpcChannel.CreateInternalHttpInvoker(HttpMessageHandler handler)
at Grpc.Net.Client.GrpcChannel..ctor(Uri address, GrpcChannelOptions channelOptions)
at Grpc.Net.Client.GrpcChannel.ForAddress(Uri address, GrpcChannelOptions channelOptions)
at Grpc.Net.Client.GrpcChannel.ForAddress(Uri address)
We face a similar issue. Behind our corporate proxy load-balancing does not work:
2024-04-04T06:42:16.9695242Z:Exporter failed send data to collector to {0} endpoint. Data will not be sent. Exception: {1}{https://xxx.apm.westeurope.azure.elastic-cloud.com/}{Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: Unable to get subchannel from HttpRequestMessage. (127.0.0.1:9000) InvalidOperationException: Unable to get subchannel from HttpRequestMessage.", DebugException="System.Net.Http.HttpRequestException: Unable to get subchannel from HttpRequestMessage. (127.0.0.1:9000)")
---> System.Net.Http.HttpRequestException: Unable to get subchannel from HttpRequestMessage. (127.0.0.1:9000)
---> System.InvalidOperationException: Unable to get subchannel from HttpRequestMessage.
at Grpc.Net.Client.Balancer.Internal.BalancerHttpHandler.OnConnect(SocketsHttpConnectionContext context, CancellationToken cancellationToken) in /_/src/Grpc.Net.Client/Balancer/Internal/BalancerHttpHandler.cs:line 89
at System.Net.Http.HttpConnectionPool.ConnectToTcpHostAsync(String host, Int32 port, HttpRequestMessage initialRequest, Boolean async, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
It requires to set the HttpHandler property of GrpcChannelOptions. Without this possibility we have to stick with version 1.5 of the OpenTelemetry.Exporter.OpenTelemetryProtocol package. An upgrade to version 1.6 results in the problem described above.
Feature Request
Is your feature request related to a problem?
Unable to use grpc exporter in BlazorWasm with current OpenTelemetry grpc exporter code. Currently
GrpcChannel
is created with defaultGrpcChannelOptions
which default ot usingSocketsHttpHandler
and invoke load balancing code which ends up crashing.Describe the solution you'd like:
I want to introduce a class
And augment
OtlpGrpcTraceExportClient
to somehow consume these options which then will be passed toOtlpExporterOptionsExtensions.CreateChannel
What do you want to happen instead? What is the expected behavior?
I want to provide a custom
HttpClient/HttpClientHandler
so grpc exporter in wasm won't crashWhich alternative solutions or features have you considered?
Alternative solution would be using HttpProtobuf but it requires keeping track of special endpoint for wasm and it is less effective than grpc
Additional Context
Add any other context about the feature request here.
The text was updated successfully, but these errors were encountered: