public async Task FlushTwice()
        {
            var w = new ExporterWriter(_exporter.Object, new NullMetrics());
            await w.FlushAndCloseAsync();

            await w.FlushAndCloseAsync();
        }
예제 #2
0
        public SendTracesToZipkinCollector()
        {
            int collectorPort  = 9411;
            var agentUri       = new Uri($"http://localhost:{collectorPort}/api/v2/spans");
            var exporter       = new ZipkinExporter(agentUri);
            var exporterWriter = new ExporterWriter(exporter, new NullMetrics());

            _tracer          = new Tracer(new TracerSettings(), plugins: null, exporterWriter, sampler: null, scopeManager: null, statsd: null);
            _zipkinCollector = new MockZipkinCollector(collectorPort);
        }
        public ExporterWriterTests()
        {
            var tracer = new Mock <IDatadogTracer>();

            tracer.Setup(x => x.DefaultServiceName).Returns("Default");

            _exporter       = new Mock <IExporter>();
            _exporterWriter = new ExporterWriter(_exporter.Object, new NullMetrics());

            var parentSpanContext = new Mock <ISpanContext>();
            var traceContext      = new Mock <ITraceContext>();

            _spanContext = new SpanContext(parentSpanContext.Object, traceContext.Object, serviceName: null);
        }