[skip ci]Add msgstream trace comment (#8349)

Signed-off-by: godchen <qingxiang.chen@zilliz.com>
pull/8246/head
godchen 2021-09-23 17:11:54 +08:00 committed by GitHub
parent 78e8e4aa22
commit 3c8f031968
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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