/// <summary>
 /// Creates an instance of <see cref="ITracer"/>.
 /// </summary>
 /// <param name="startEndHandler">Start/end event handler.</param>
 /// <param name="traceConfig">Trace configuration.</param>
 /// <param name="spanExporter">Exporter for span.</param>
 /// <param name="binaryFormat">Binary format context propagator.</param>
 /// <param name="textFormat">Text format context propagator.</param>
 public Tracer(IStartEndHandler startEndHandler, ITraceConfig traceConfig, SpanExporter spanExporter, IBinaryFormat binaryFormat, ITextFormat textFormat)
 {
     this.spanBuilderOptions = new SpanBuilderOptions(startEndHandler, traceConfig);
     this.spanExporter       = spanExporter ?? (SpanExporter)SpanExporter.Create(ExporterBufferSize, ExporterScheduleDelay);
     this.BinaryFormat       = binaryFormat ?? new BinaryFormat();
     this.TextFormat         = textFormat ?? new TraceContextFormat();
 }
Beispiel #2
0
 private SpanBuilder(string name, SpanKind kind, SpanBuilderOptions options, SpanContext parentContext = null, ISpan parent = null) : base(kind)
 {
     this.Name              = name ?? throw new ArgumentNullException(nameof(name));
     this.Parent            = parent;
     this.ParentSpanContext = parentContext;
     this.Options           = options;
 }
Beispiel #3
0
 public Tracer(IRandomGenerator randomGenerator, IStartEndHandler startEndHandler, ITraceConfig traceConfig, IExportComponent exportComponent, IBinaryFormat binaryFormat, ITextFormat textFormat)
 {
     this.spanBuilderOptions = new SpanBuilderOptions(randomGenerator, startEndHandler, traceConfig);
     this.BinaryFormat       = binaryFormat ?? new BinaryFormat();
     this.TextFormat         = textFormat ?? new TraceContextFormat();
     this.exportComponent    = exportComponent;
 }
Beispiel #4
0
        internal SpanBuilder(string name, SpanBuilderOptions options)
        {
            // TODO: remove with next DiagnosticSource preview, switch to Activity setidformat
            Activity.DefaultIdFormat      = ActivityIdFormat.W3C;
            Activity.ForceDefaultIdFormat = true;

            this.name    = name ?? throw new ArgumentNullException(nameof(name));
            this.options = options ?? throw new ArgumentNullException(nameof(options));
        }
Beispiel #5
0
 internal static ISpanBuilder Create(string name, SpanKind kind, SpanContext parentContext, SpanBuilderOptions options)
 {
     return(new SpanBuilder(name, kind, options, parentContext, null));
 }
Beispiel #6
0
 internal static ISpanBuilder Create(string name, SpanKind kind, ISpan parent, SpanBuilderOptions options)
 {
     return(new SpanBuilder(name, kind, options, null, parent));
 }
Beispiel #7
0
 internal SpanBuilder(string name, SpanBuilderOptions options)
 {
     this.name    = name ?? throw new ArgumentNullException(nameof(name));
     this.options = options;
 }
Beispiel #8
0
 public Tracer(IRandomGenerator randomGenerator, IStartEndHandler startEndHandler, ITraceConfig traceConfig, IExportComponent exportComponent)
 {
     this.spanBuilderOptions = new SpanBuilderOptions(randomGenerator, startEndHandler, traceConfig);
 }
Beispiel #9
0
 internal static ISpanBuilder CreateWithRemoteParent(string spanName, SpanKind kind, ISpanContext remoteParentSpanContext, SpanBuilderOptions options)
 {
     return(new SpanBuilder(spanName, kind, options, remoteParentSpanContext, null));
 }