public InterceptedServerHandler(ServerTracingConfiguration configuration, ServerCallContext context) { _configuration = configuration; _context = context; var span = GetSpanFromContext(); _logger = new GrpcTraceLogger <TRequest, TResponse>(span, configuration); var scopeActions = new ScopeActions("new_request", _logger.BeginScope, _logger.EndScope); _streamActions = new TracingAsyncStreamReader <TRequest> .StreamActions(scopeActions, _logger.Request); }
public InterceptedClientHandler(ClientTracingConfiguration configuration, ClientInterceptorContext <TRequest, TResponse> context) { _configuration = configuration; _context = context; var callOptions = ApplyConfigToCallOptions(_context.Options); if (!Equals(callOptions, context.Options)) { _context = new ClientInterceptorContext <TRequest, TResponse>(context.Method, context.Host, callOptions); } var span = InitializeSpanWithHeaders(); _logger = new GrpcTraceLogger <TRequest, TResponse>(span, configuration); _configuration.Tracer.Inject(span.Context, BuiltinFormats.HttpHeaders, new MetadataCarrier(_context.Options.Headers)); var scopeActions = new ScopeActions("new_response", _logger.BeginScope, _logger.EndScope); _streamActions = new TracingAsyncStreamReader <TResponse> .StreamActions(scopeActions, _logger.Response, _logger.FinishSuccess, _logger.FinishException); }