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
TBH I'm still trying to fully understand the capabilities, so please excuse any ignorance.
It would be great to have the ability to disable trace capture for any given gRPC Client, ether one the client of more generally as part of the provider setup.
I note that the Http Client via .AddHttpClientInstrumentation(c => c.FilterHttpRequestMessage = FilterHttpRequestMessage) allows one to filer specific requests, and whist the gRPC Client implementation appears to be built upon this, and I can filter the HTTP aspect, I can't it seems suppress the gRPC calls.
I also looked at the .AddGrpcClientInstrumentation(opt => opt.SuppressDownstreamInstrumentation = true) but this seems have issues per #1727
I've also attempted to implement a gRPC client Interceptor (given hints from here), but seem the Current Activity is null so it does nothing:
publicclassClientTraceInterceptor:Interceptor{publicoverrideAsyncUnaryCall<TResponse>AsyncUnaryCall<TRequest,TResponse>(TRequestrequest,ClientInterceptorContext<TRequest,TResponse>context,AsyncUnaryCallContinuation<TRequest,TResponse>continuation){varactivity=Activity.Current;if(activityis not null){activity.ActivityTraceFlags&=~ActivityTraceFlags.Recorded;activity.IsAllDataRequested=false;}Activity.Current=null;varcall=continuation(request,context);returnnewAsyncUnaryCall<TResponse>(HandleResponse(call.ResponseAsync),call.ResponseHeadersAsync,call.GetStatus,call.GetTrailers,call.Dispose);}privatestaticasyncTask<TResponse>HandleResponse<TResponse>(Task<TResponse>inner){try{returnawaitinner;}catch(Exceptionex){thrownewInvalidOperationException("Custom error",ex);}}}
My use case, is that I have internal gRPC activity from one gRPC client that is not on the hot path, and only want to show traces for what is actually hot path via other gRPC clients.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TBH I'm still trying to fully understand the capabilities, so please excuse any ignorance.
It would be great to have the ability to disable trace capture for any given gRPC Client, ether one the client of more generally as part of the provider setup.
I note that the Http Client via
.AddHttpClientInstrumentation(c => c.FilterHttpRequestMessage = FilterHttpRequestMessage)
allows one to filer specific requests, and whist the gRPC Client implementation appears to be built upon this, and I can filter the HTTP aspect, I can't it seems suppress the gRPC calls.I also looked at the
.AddGrpcClientInstrumentation(opt => opt.SuppressDownstreamInstrumentation = true)
but this seems have issues per #1727I've also attempted to implement a gRPC client Interceptor (given hints from here), but seem the Current Activity is null so it does nothing:
My use case, is that I have internal gRPC activity from one gRPC client that is not on the hot path, and only want to show traces for what is actually hot path via other gRPC clients.
Beta Was this translation helpful? Give feedback.
All reactions