internal static async Task <byte[]> SerializeThrift(JaegerBatch batch) { var transport = new TMemoryBufferClientTransport(); var protocol = new TBinaryProtocol(transport); await batch.WriteAsync(protocol, new CancellationToken()); return(transport.GetBuffer()); }
protected override async Task <int> SendAsync(List <JaegerSpan> spans, CancellationToken cancellationToken) { var batch = new JaegerBatch(_process, spans); await batch.WriteAsync(_protocol, cancellationToken); await _protocol.Transport.FlushAsync(cancellationToken); return(spans.Count); }
protected override async Task SendAsync(ThriftProcess process, List <ThriftSpan> spans, CancellationToken cancellationToken) { try { var batch = new ThriftBatch(process, spans); await batch.WriteAsync(_protocol, cancellationToken).ConfigureAwait(false); await _protocol.Transport.FlushAsync(cancellationToken).ConfigureAwait(false); } catch (Exception ex) { throw new SenderException($"Could not send {spans.Count} spans", ex, spans.Count); } }