/// <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(); }
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; }
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; }
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)); }
internal static ISpanBuilder Create(string name, SpanKind kind, SpanContext parentContext, SpanBuilderOptions options) { return(new SpanBuilder(name, kind, options, parentContext, null)); }
internal static ISpanBuilder Create(string name, SpanKind kind, ISpan parent, SpanBuilderOptions options) { return(new SpanBuilder(name, kind, options, null, parent)); }
internal SpanBuilder(string name, SpanBuilderOptions options) { this.name = name ?? throw new ArgumentNullException(nameof(name)); this.options = options; }
public Tracer(IRandomGenerator randomGenerator, IStartEndHandler startEndHandler, ITraceConfig traceConfig, IExportComponent exportComponent) { this.spanBuilderOptions = new SpanBuilderOptions(randomGenerator, startEndHandler, traceConfig); }
internal static ISpanBuilder CreateWithRemoteParent(string spanName, SpanKind kind, ISpanContext remoteParentSpanContext, SpanBuilderOptions options) { return(new SpanBuilder(spanName, kind, options, remoteParentSpanContext, null)); }