// Returns the SpanId of the newly-created Span in the EventTracer public SpanId AddSpan(SpanId[] causes) { unsafe { if (causes == null) { return(AddSpan()); } var causeIds = new CEventTrace.SpanId[causes.Length]; for (var i = 0; i < causes.Length; i++) { causeIds[i] = ParameterConversion.ConvertSpanId(causes[i]); } CEventTrace.SpanId createdSpanId; fixed(CEventTrace.SpanId *fixedCauseIds = causeIds) { createdSpanId = CEventTrace.EventTracerAddSpan(eventTracer, fixedCauseIds, (uint)causeIds.Length); } var newSpanId = new SpanId(); ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize); return(newSpanId); } }
public SpanId AddSpan() { var newSpanId = new SpanId(); unsafe { var createdSpanId = CEventTrace.EventTracerAddSpan(eventTracer, null, 0); ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize); } return(newSpanId); }
public SpanId AddSpan(SpanId spanId) { var newSpanId = new SpanId(); unsafe { var internalSpanId = ParameterConversion.ConvertSpanId(spanId); var createdSpanId = CEventTrace.EventTracerAddSpan(eventTracer, &internalSpanId, 1); ApiInterop.Memcpy(newSpanId.Data, createdSpanId.Data, SpanId.SpanIdSize); } return(newSpanId); }