public ISpan Start() { Trace trace = CreateTrace(); OtSpanKind spanKind = GetSpanKind(); RecordAnnotation(trace, GetOpeningAnnotation(spanKind)); RecordAnnotation(trace, Annotations.ServiceName(_tracer.ServiceName)); RecordAnnotation(trace, Annotations.Rpc(_operationName)); return(new OtSpan(trace, spanKind, _tags)); }
public OtSpan(Trace trace, OtSpanKind spanKind, Dictionary <string, string> tags) { _spanKind = spanKind; Trace = trace; Context = new OtSpanContext(trace); if (tags != null) { foreach (var entry in tags) { SetZipkinTag(entry.Key, entry.Value); } } }
private static IAnnotation GetClosingAnnotation(OtSpanKind spanKind) { switch (spanKind) { case OtSpanKind.Client: return(Annotations.ClientRecv()); case OtSpanKind.Server: return(Annotations.ServerSend()); case OtSpanKind.Local: return(Annotations.LocalOperationStop()); default: throw new NotSupportedException("SpanKind: " + spanKind + " unknown."); } }
private IAnnotation GetOpeningAnnotation(OtSpanKind spanKind) { switch (spanKind) { case OtSpanKind.Client: return(Annotations.ClientSend()); case OtSpanKind.Server: return(Annotations.ServerRecv()); case OtSpanKind.Local: return(Annotations.LocalOperationStart(_tracer.ServiceName)); default: throw new NotSupportedException("SpanKind: " + spanKind + " unknown."); } }
public ISpan Start() { Trace trace = CreateTrace(); OtSpanKind spanKind = GetSpanKind(); RecordAnnotation(trace, GetOpeningAnnotation(spanKind)); RecordAnnotation(trace, Annotations.ServiceName(_tracer.ServiceName)); if (spanKind == OtSpanKind.Producer || spanKind == OtSpanKind.Consumer) { RecordAnnotation(trace, Annotations.Rpc(_operationName)); } else { RecordAnnotation(trace, Annotations.Rpc(_operationName)); } return(new OtSpan(trace, spanKind, _tags)); }