public static Google.Cloud.Trace.V2.Span.Types.Link ToLink(this ILink link) { var ret = new Google.Cloud.Trace.V2.Span.Types.Link(); ret.SpanId = link.Context.SpanId.ToLowerBase16(); ret.TraceId = link.Context.TraceId.ToLowerBase16(); if (link.Attributes != null) { ret.Attributes = new Google.Cloud.Trace.V2.Span.Types.Attributes { DroppedAttributesCount = OpenTelemetry.Trace.Config.TraceParams.Default.MaxNumberOfAttributes - link.Attributes.Count, AttributeMap = { link.Attributes.ToDictionary( att => att.Key, att => att.Value.ToAttributeValue()) } }; } return(ret); }
public static Google.Cloud.Trace.V2.Span.Types.Link ToLink(this Link link) { var ret = new Google.Cloud.Trace.V2.Span.Types.Link(); ret.SpanId = link.Context.SpanId.ToHexString(); ret.TraceId = link.Context.TraceId.ToHexString(); if (link.Attributes != null) { ret.Attributes = new Google.Cloud.Trace.V2.Span.Types.Attributes { AttributeMap = { link.Attributes.ToDictionary( att => att.Key, att => att.Value.ToAttributeValue()), }, }; } return(ret); }