private static void SetSpanAttributes(Activity activity, IOutgoingPhysicalMessageContext context, TelemetrySpan span) { span.SetAttribute("messaging.message_id", context.MessageId); span.SetAttribute("messaging.message_payload_size_bytes", context.Body.Length); span.ApplyContext(context.Builder.Build <ReadOnlySettings>(), context.Headers); foreach (var tag in activity.Tags) { span.SetAttribute($"messaging.nservicebus.{tag.Key.ToLowerInvariant()}", tag.Value); } }