public InterceptedClientHandler(ClientTracingConfiguration configuration, ClientInterceptorContext <TRequest, TResponse> context) { _configuration = configuration; _context = context; if (context.Options.Headers == null) { _context = new ClientInterceptorContext <TRequest, TResponse>(context.Method, context.Host, context.Options.WithHeaders(new Metadata())); // Add empty metadata to options } var span = InitializeSpanWithHeaders(); _logger = new GrpcTraceLogger <TRequest, TResponse>(span, configuration); _configuration.Tracer.Inject(span.Context, BuiltinFormats.HttpHeaders, new MetadataCarrier(_context.Options.Headers)); }
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)); }
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); }
public InterceptedClientHandler(ClientTracingConfiguration configuration) { _configuration = configuration; }
private ClientTracingInterceptor(ClientTracingConfiguration configuration) { _configuration = configuration; }
public ClientTracingInterceptor(ITracer tracer) { GrpcPreconditions.CheckNotNull(tracer, nameof(tracer)); _configuration = new ClientTracingConfiguration(tracer); }
public ClientTracingInterceptor Build() { var configuration = new ClientTracingConfiguration(_tracer, _operationNameConstructor, _streaming, _verbose, _tracedAttributes); return(new ClientTracingInterceptor(configuration)); }
public ClientTracingInterceptor Build() { var configuration = new ClientTracingConfiguration(_tracer, _operationNameConstructor, _streaming, _streamingInputSpans, _verbose, _tracedAttributes, _waitForReady, _cancellationToken); return(new ClientTracingInterceptor(configuration)); }
private ClientTracingInterceptor(ClientTracingConfiguration configuration) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); }
public ClientTracingInterceptor(ITracer tracer) { _configuration = new ClientTracingConfiguration(tracer); }