-
Notifications
You must be signed in to change notification settings - Fork 773
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
Support user provided grpc CallInvoker #5028
Comments
This seems like a good candidate #4815. It's sad it was closed due to inactivitity. Is it possible to revive that PR? |
Hej Claus @cvi-mft ;-) Did you come across anything interesting after this comment? |
Hej Mads @madskonradsen. Lol. I do not use Blazor. I am using #4815 with great success in standard ASP.NET applications with the following factory: o.CallInvokerFactory = uri =>
{
var azureCredential = new DefaultAzureCredential();
var credentials = CallCredentials.FromInterceptor(async (_, metadata) =>
{
var token = await azureCredential.GetTokenAsync(new TokenRequestContext([
scope
]));
metadata.Add("Authorization", $"Bearer {token.Token}");
});
return GrpcChannel.ForAddress(uri,
new GrpcChannelOptions
{
Credentials = ChannelCredentials.Create(new SslCredentials(), credentials)
}).CreateCallInvoker();
}; |
HAH! Love that you probably deploy a patched DLL to prod! |
Feature Request
It would be great if we could have a
Func<CallInvoker>
for the grpc protocol similar to the currentFunc<HttpClient> HttpClientFactory
for http protocol. There are numerous cases where customising the grpc client is valuable and right now there is not much flexibility in terms of customising the grpc channel. The grpc CallInvoker would allow custom interceptors, clientside load balancing configuration, retry strategy configuration, custom error handling, etc which are all currently not supported in openteletry-dotnet from what I can seeIs your feature request related to a problem?
No
Describe the solution you'd like:
OtlpExporterOptions.cs
to be extended with a new propertypublic Func<CallInvoker> GrpcCallInvoker { get; set; }
which, when provided, will be used instead of the internalChannel
that lives inside ofBaseOtlpGrpcExportClient<TRequest>
. Allowing for the consumer of theOpenTelemetry.Exporter.OpenTelemetryProtocol
package to configure the grpc client as they wishDescribe alternatives you've considered.
The alternative may be to provide a lot of additional options for every feature that may be requested such as #3272, #1779, or for the consumers to need to implement the entire exporter themselves. Another option may be to expose some support for
Grpc.Net.ClientFactory
although this would only work for framework versions that support grpc-dotnet.Additional Context
My company already has a bunch of tooling around grpc which generates our own grpc client factory which wraps the CallInvoker with a set of interceptors and configuration which has worked very well for us. It would be great if we could re-use this tooling for
OpenTelemetry.Exporter.OpenTelemetryProtocol
as right now anytime we see grpc client issues in opentelemetry-dotnet there is very little flexibility in terms of options for us to tweak to improve thsThe text was updated successfully, but these errors were encountered: