private void Send(WavefrontSpan span)
        {
            try
            {
                var context          = (WavefrontSpanContext)span.Context;
                var parentReferences = span.GetParents();
                var followReferences = span.GetFollows();

                var parents = parentReferences?
                              .Select(parent => parent.SpanContext.GetSpanId())
                              .ToList();

                var follows = followReferences?
                              .Select(follow => follow.SpanContext.GetSpanId())
                              .ToList();

                WavefrontSender.SendSpan(
                    span.GetOperationName(), span.GetStartTimeMicros() / 1000,
                    span.GetDurationMicros() / 1000, Source, context.GetTraceId(),
                    context.GetSpanId(), parents, follows, span.GetTagsAsList().ToList(),
                    reportSpanLogs ? span.GetSpanLogs().ToList() : null
                    );
            }
            catch (IOException e)
            {
                if (LoggingAllowed())
                {
                    logger.LogWarning(0, e, "Error reporting span: " + span);
                }
                spansDropped?.Inc();
                reportErrors?.Inc();
            }
        }
        /// <inheritdoc />
        public void Report(WavefrontSpan span)
        {
            try
            {
                var context          = (WavefrontSpanContext)span.Context;
                var parentReferences = span.GetParents();
                var followReferences = span.GetFollows();

                var parents = parentReferences?
                              .Select(parent => parent.SpanContext.GetSpanId())
                              .ToList();

                var follows = followReferences?
                              .Select(follow => follow.SpanContext.GetSpanId())
                              .ToList();

                wavefrontSender.SendSpan(
                    span.GetOperationName(), span.GetStartTimeMillis(), span.GetDurationMillis(),
                    source, context.GetTraceId(), context.GetSpanId(), parents, follows,
                    span.GetTagsAsList().ToList(), null
                    );
            }
            catch (IOException)
            {
                if (logger.IsEnabled(LogLevel.Debug))
                {
                    logger.Log(LogLevel.Debug, "Dropping span " + span);
                }
            }
        }
Exemplo n.º 3
0
        public void Report(WavefrontSpan span)
        {
            var context          = (WavefrontSpanContext)span.Context;
            var parentReferences = span.GetParents();
            var followReferences = span.GetFollows();

            var parents = parentReferences?
                          .Select(parent => parent.SpanContext.GetSpanId())
                          .ToList();

            var follows = followReferences?
                          .Select(follow => follow.SpanContext.GetSpanId())
                          .ToList();

            var spanLine = Utils.TracingSpanToLineData(
                span.GetOperationName(), span.GetStartTimeMillis(), span.GetDurationMillis(),
                source, context.GetTraceId(), context.GetSpanId(), parents, follows,
                span.GetTagsAsList().ToList(), null, "unknown"
                );

            Console.WriteLine("Finished span: " + spanLine);
        }
Exemplo n.º 4
0
        public void Report(WavefrontSpan span)
        {
            var context          = (WavefrontSpanContext)span.Context;
            var parentReferences = span.GetParents();
            var followReferences = span.GetFollows();

            var parents = parentReferences?
                          .Select(parent => parent.SpanContext.GetSpanId())
                          .ToList();

            var follows = followReferences?
                          .Select(follow => follow.SpanContext.GetSpanId())
                          .ToList();

            var spanLine = Utils.TracingSpanToLineData(
                span.GetOperationName(), span.GetStartTimeMicros(), span.GetDurationMicros(),
                source, context.GetTraceId(), context.GetSpanId(), parents, follows,
                span.GetTagsAsList().ToList(), null, defaultSource
                );

            Console.WriteLine($"Finished span: sampling={context.GetSamplingDecision()} {spanLine}");

            var spanLogs = span.GetSpanLogs();

            if (spanLogs != null && spanLogs.Count > 0)
            {
                try
                {
                    Console.WriteLine("Span logs: " + Utils.SpanLogsToLineData(
                                          context.GetTraceId(), context.GetSpanId(), spanLogs.ToList()));
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error processing span logs: " + e);
                }
            }
        }