/// <summary> /// Convert this span binary annotation object to its Thrift equivalent. /// </summary> /// <returns></returns> public static Thrift.BinaryAnnotation ConvertToThrift(BinaryAnnotation binaryAnnotation, Thrift.Endpoint spanEndpoint) { var host = spanEndpoint; var endpoint = binaryAnnotation.Host; if (endpoint != null) { host = ConvertToThrift(endpoint.IPEndPoint, endpoint.ServiceName ?? spanEndpoint.Service_name); } return(new Thrift.BinaryAnnotation { Annotation_type = binaryAnnotation.AnnotationType, Key = binaryAnnotation.Key, Value = binaryAnnotation.Value, Host = host }); }
/// <summary> /// Convert this annotation object to its Thrift equivalent. /// </summary> /// <returns></returns> public static Thrift.Annotation ConvertToThrift(ZipkinAnnotation zipkinAnnotation, Thrift.Endpoint host) { var thriftAnn = new Thrift.Annotation { Timestamp = zipkinAnnotation.Timestamp.ToUnixTimestamp(), Value = zipkinAnnotation.Value, Host = host }; return(thriftAnn); }