public JaegerProcess BuildJaegerProcessThrift(ILetsTraceTracer tracer) { return(new JaegerProcess(tracer.ServiceName) { Tags = BuildJaegerTags(tracer.Tags) }); }
public SpanBuilder(ILetsTraceTracer tracer, string operationName, ISampler sampler, IMetrics metrics) { _tracer = tracer ?? throw new ArgumentNullException(nameof(tracer)); _operationName = operationName ?? throw new ArgumentNullException(nameof(operationName)); _sampler = sampler ?? throw new ArgumentNullException(nameof(sampler)); _metrics = metrics ?? throw new ArgumentNullException(nameof(metrics)); // There will be tags in most cases so it should be fine to always initiate this variable. _tags = new Dictionary <string, object>(); }
public Span(ILetsTraceTracer tracer, string operationName, ILetsTraceSpanContext context, DateTime?startTimestampUtc = null, Dictionary <string, object> tags = null, List <Reference> references = null) { Tracer = tracer ?? throw new ArgumentNullException(nameof(tracer)); if (string.IsNullOrEmpty(operationName)) { var nullOrEmpty = operationName == null ? "null" : "empty"; throw new ArgumentException($"Argument is {nullOrEmpty}", nameof(operationName)); } OperationName = operationName; Context = context ?? throw new ArgumentNullException(nameof(context)); StartTimestampUtc = startTimestampUtc ?? Tracer.Clock.UtcNow(); Tags = tags ?? new Dictionary <string, object>(); References = references ?? Enumerable.Empty <Reference>(); }
public TracerTests() { _mockReporter = Substitute.For <IReporter>(); _operationName = "GET::api/values/"; _serviceName = "testingService"; _mockSampler = Substitute.For <ISampler>(); _mockScopeManager = Substitute.For <IScopeManager>(); _mockInjector = Substitute.For <IInjector>(); _mockExtractor = Substitute.For <IExtractor>(); _format = new Builtin <string>("format"); _propagationRegistry = new PropagationRegistry(); _propagationRegistry.AddCodec(_format, _mockInjector, _mockExtractor); _ip = "192.168.1.1"; _builtTracer = new Tracer.Builder(_serviceName) .WithReporter(_mockReporter) .WithSampler(_mockSampler) .WithScopeManager(_mockScopeManager) .WithPropagationRegistry(_propagationRegistry) .WithTag(Constants.TracerIpTagKey, _ip) .Build(); }
public TracingWrapper(IHostingEnvironment env, IReporter reporter, ISampler sampler) { _tracer = new Tracer(env.ApplicationName, reporter, "192.168.1.1", sampler); }
internal static JaegerProcess BuildJaegerProcessThrift(ILetsTraceTracer tracer) { return(new JaegerProcess(tracer.ServiceName)); }