public OpenTracingSendTracesToAgent() { var uri = new Uri("http://localhost:8126"); _httpRecorder = new RecordHttpHandler(); _tracer = OpenTracingTracerFactory.CreateTracer(uri, null, _httpRecorder); }
public SendTracesToZipkinCollector() { var settings = new TracerSettings(); _httpRecorder = new RecordHttpHandler(); var api = new ZipkinApi(settings, _httpRecorder, statsd: null); var agentWriter = new AgentWriter(api, statsd: null); _tracer = new Tracer(settings, agentWriter, sampler: null, scopeManager: null, statsd: null); }
public SendTracesToAgent() { var settings = new TracerSettings(); var endpoint = new Uri("http://localhost:8126"); _httpRecorder = new RecordHttpHandler(); var api = new Api(endpoint, _httpRecorder); var agentWriter = new AgentWriter(api); _tracer = new Tracer(settings, agentWriter, sampler: null, scopeManager: null); }
public OpenTracingSendTracesToAgent() { var settings = new TracerSettings(); _httpRecorder = new RecordHttpHandler(); var api = new ZipkinApi(settings, _httpRecorder); var agentWriter = new AgentWriter(api, statsd: null, synchronousSend: false); var tracer = new Tracer(settings, agentWriter, sampler: null, scopeManager: null, statsd: null); _tracer = new OpenTracingTracer(tracer); }
public SendTracesToAgent() { var settings = new TracerSettings(); var endpoint = new Uri("http://localhost:8126"); _httpRecorder = new RecordHttpHandler(); var api = new Api(endpoint, apiRequestFactory: null, statsd: null); var agentWriter = new AgentWriter(api, new NullMetrics()); _tracer = new Tracer(settings, plugins: null, agentWriter, sampler: null, scopeManager: null, statsd: null); }
public async void CustomServiceName() { const string ServiceName = "MyService"; _httpRecorder = new RecordHttpHandler(); _tracer = Tracer.Create(new Uri("http://localhost:8126"), null, _httpRecorder); var scope = _tracer.StartActive("Operation", serviceName: ServiceName); scope.Span.ResourceName = "This is a resource"; scope.Dispose(); // Check that the HTTP calls went as expected await _httpRecorder.WaitForCompletion(1); Assert.Single(_httpRecorder.Requests); Assert.Single(_httpRecorder.Responses); Assert.All(_httpRecorder.Responses, (x) => Assert.Equal(HttpStatusCode.OK, x.StatusCode)); var trace = _httpRecorder.Traces.Single(); MsgPackHelpers.AssertSpanEqual(scope.Span, trace.Single()); }
public SendTracesToAgent() { _httpRecorder = new RecordHttpHandler(); _tracer = Tracer.Create(new Uri("http://localhost:8126"), null, _httpRecorder); }