From 3c8f0319681bd34853b6a52b29333b9e2537e23e Mon Sep 17 00:00:00 2001 From: godchen Date: Thu, 23 Sep 2021 17:11:54 +0800 Subject: [PATCH] [skip ci]Add msgstream trace comment (#8349) Signed-off-by: godchen --- internal/msgstream/trace.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/msgstream/trace.go b/internal/msgstream/trace.go index e9d915ed8e..f743eaa702 100644 --- a/internal/msgstream/trace.go +++ b/internal/msgstream/trace.go @@ -24,6 +24,8 @@ import ( "github.com/milvus-io/milvus/internal/util/trace" ) +// ExtractFromPulsarMsgProperties extracts trace span from msg.properties. +// And it will attach some default tags to the span. func ExtractFromPulsarMsgProperties(msg TsMsg, properties map[string]string) (opentracing.Span, bool) { if !allowTrace(msg) { return trace.NoopSpan(), false @@ -42,6 +44,8 @@ func ExtractFromPulsarMsgProperties(msg TsMsg, properties map[string]string) (op return opentracing.StartSpan(name, opts...), true } +// MsgSpanFromCtx extracts the span from context. +// And it will attach some default tags to the span. func MsgSpanFromCtx(ctx context.Context, msg TsMsg, opts ...opentracing.StartSpanOption) (opentracing.Span, context.Context) { if ctx == nil { return trace.NoopSpan(), ctx