mirror of https://github.com/milvus-io/milvus.git
[skip ci]Add msgstream trace comment (#8349)
Signed-off-by: godchen <qingxiang.chen@zilliz.com>pull/8246/head
parent
78e8e4aa22
commit
3c8f031968
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue