mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 09:38:39 +08:00
Add opentrace log for index component (#7946)
Signed-off-by: cai.zhang <cai.zhang@zilliz.com>
This commit is contained in:
parent
b465e8f9a4
commit
4814f9cb1c
@ -69,7 +69,7 @@ func (s *Server) init() error {
|
|||||||
indexcoord.Params.Address = Params.ServiceAddress
|
indexcoord.Params.Address = Params.ServiceAddress
|
||||||
indexcoord.Params.Port = Params.ServicePort
|
indexcoord.Params.Port = Params.ServicePort
|
||||||
|
|
||||||
closer := trace.InitTracing("index_coord")
|
closer := trace.InitTracing("IndexCoord")
|
||||||
s.closer = closer
|
s.closer = closer
|
||||||
|
|
||||||
if err := s.indexcoord.Register(); err != nil {
|
if err := s.indexcoord.Register(); err != nil {
|
||||||
|
|||||||
@ -104,7 +104,7 @@ func (s *Server) init() error {
|
|||||||
indexnode.Params.IP = Params.IP
|
indexnode.Params.IP = Params.IP
|
||||||
indexnode.Params.Address = Params.Address
|
indexnode.Params.Address = Params.Address
|
||||||
|
|
||||||
closer := trace.InitTracing(fmt.Sprintf("index_node ip: %s, port: %d", Params.IP, Params.Port))
|
closer := trace.InitTracing(fmt.Sprintf("IndexNode-%d", indexnode.Params.NodeID))
|
||||||
s.closer = closer
|
s.closer = closer
|
||||||
|
|
||||||
Params.Address = Params.IP + ":" + strconv.FormatInt(int64(Params.Port), 10)
|
Params.Address = Params.IP + ":" + strconv.FormatInt(int64(Params.Port), 10)
|
||||||
|
|||||||
@ -342,14 +342,13 @@ func (i *IndexCoord) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequ
|
|||||||
return i.sched.IndexAddQueue.Enqueue(t)
|
return i.sched.IndexAddQueue.Enqueue(t)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
err := fn()
|
err := fn()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ret.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
ret.Status.ErrorCode = commonpb.ErrorCode_UnexpectedError
|
||||||
ret.Status.Reason = err.Error()
|
ret.Status.Reason = err.Error()
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
log.Debug("IndexCoord BuildIndex Enqueue successfully", zap.Any("IndexBuildID", indexBuildID))
|
log.Debug("IndexCoord BuildIndex Enqueue successfully", zap.Any("IndexBuildID", t.indexBuildID))
|
||||||
|
|
||||||
err = t.WaitToFinish()
|
err = t.WaitToFinish()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -357,6 +356,7 @@ func (i *IndexCoord) BuildIndex(ctx context.Context, req *indexpb.BuildIndexRequ
|
|||||||
ret.Status.Reason = err.Error()
|
ret.Status.Reason = err.Error()
|
||||||
return ret, nil
|
return ret, nil
|
||||||
}
|
}
|
||||||
|
sp.SetTag("IndexCoord-IndexBuildID", strconv.FormatInt(t.indexBuildID, 10))
|
||||||
ret.Status.ErrorCode = commonpb.ErrorCode_Success
|
ret.Status.ErrorCode = commonpb.ErrorCode_Success
|
||||||
ret.IndexBuildID = t.indexBuildID
|
ret.IndexBuildID = t.indexBuildID
|
||||||
return ret, nil
|
return ret, nil
|
||||||
|
|||||||
@ -175,8 +175,9 @@ func (i *IndexNode) CreateIndex(ctx context.Context, request *indexpb.CreateInde
|
|||||||
zap.Any("TypeParams", request.TypeParams),
|
zap.Any("TypeParams", request.TypeParams),
|
||||||
zap.Any("IndexParams", request.IndexParams))
|
zap.Any("IndexParams", request.IndexParams))
|
||||||
|
|
||||||
sp, ctx := trace.StartSpanFromContextWithOperationName(ctx, "CreateIndex")
|
sp, ctx := trace.StartSpanFromContextWithOperationName(ctx, "IndexNode-CreateIndex")
|
||||||
defer sp.Finish()
|
defer sp.Finish()
|
||||||
|
sp.SetTag("IndexBuildID", strconv.FormatInt(request.IndexBuildID, 10))
|
||||||
|
|
||||||
t := &IndexBuildTask{
|
t := &IndexBuildTask{
|
||||||
BaseTask: BaseTask{
|
BaseTask: BaseTask{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user