Skip to content

Commit

Permalink
fix trace span name
Browse files Browse the repository at this point in the history
Signed-off-by: kevindiu <kevindiujp@gmail.com>
  • Loading branch information
kevindiu committed Jun 7, 2022
1 parent c281131 commit 8363790
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/agent/core/ngt/handler/grpc/insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func (s *server) StreamInsert(stream vald.Insert_StreamInsertServer) (err error)
func() interface{} { return new(payload.Insert_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Insert_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamInsert/id-"+req.GetVector().GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamInsertRPCName+"/id-"+req.GetVector().GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/handler/grpc/linear_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (s *server) StreamLinearSearch(stream vald.Search_StreamLinearSearchServer)
func() interface{} { return new(payload.Search_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Search_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamLinearSearch/requestID-"+req.GetConfig().GetRequestId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamLinearSearchRPCName+"/requestID-"+req.GetConfig().GetRequestId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -345,7 +345,7 @@ func (s *server) StreamLinearSearchByID(stream vald.Search_StreamLinearSearchByI
func() interface{} { return new(payload.Search_IDRequest) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Search_IDRequest)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamLinearSearchByID/id-"+req.GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamLinearSearchByIDRPCName+"/id-"+req.GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -399,7 +399,7 @@ func (s *server) MultiLinearSearch(ctx context.Context, reqs *payload.Search_Mul
wg.Add(1)
s.eg.Go(func() (err error) {
defer wg.Done()
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s.MultiLinearSearch/errgroup.Go/id-%d", apiName, idx))
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s/%s/errgroup.Go/id-%d", apiName, vald.MultiLinearSearchRPCName, idx))
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -468,7 +468,7 @@ func (s *server) MultiLinearSearchByID(ctx context.Context, reqs *payload.Search
rids = append(rids, req.GetConfig().GetRequestId())
wg.Add(1)
s.eg.Go(func() error {
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s.MultiLinearSearchByID/errgroup.Go/id-%d", apiName, idx))
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s/%s/errgroup.Go/id-%d", apiName, vald.MultiLinearSearchByIDRPCName, idx))
defer func() {
if sspan != nil {
sspan.End()
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/core/ngt/handler/grpc/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (s *server) StreamGetObject(stream vald.Object_StreamGetObjectServer) (err
func() interface{} { return new(payload.Object_VectorRequest) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Object_VectorRequest)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamGetObject/id-"+req.GetId().GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamGetObjectRPCName+"/id-"+req.GetId().GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/core/ngt/handler/grpc/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (s *server) StreamRemove(stream vald.Remove_StreamRemoveServer) (err error)
func() interface{} { return new(payload.Remove_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Remove_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamRemove/id-"+req.GetId().GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamRemoveRPCName+"/id-"+req.GetId().GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down
8 changes: 4 additions & 4 deletions pkg/agent/core/ngt/handler/grpc/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ func (s *server) StreamSearch(stream vald.Search_StreamSearchServer) (err error)
func() interface{} { return new(payload.Search_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Search_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamSearch/requestID-"+req.GetConfig().GetRequestId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamSearchRPCName+"/requestID-"+req.GetConfig().GetRequestId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -350,7 +350,7 @@ func (s *server) StreamSearchByID(stream vald.Search_StreamSearchByIDServer) (er
func() interface{} { return new(payload.Search_IDRequest) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Search_IDRequest)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamSearchByID/id-"+req.GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamSearchByIDRPCName+"/id-"+req.GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -404,7 +404,7 @@ func (s *server) MultiSearch(ctx context.Context, reqs *payload.Search_MultiRequ
wg.Add(1)
s.eg.Go(func() (err error) {
defer wg.Done()
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s.MultiSearch/errgroup.Go/id-%d", apiName, idx))
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s/%s/errgroup.Go/id-%d", apiName, vald.MultiSearchRPCName, idx))
defer func() {
if sspan != nil {
sspan.End()
Expand Down Expand Up @@ -473,7 +473,7 @@ func (s *server) MultiSearchByID(ctx context.Context, reqs *payload.Search_Multi
rids = append(rids, req.GetConfig().GetRequestId())
wg.Add(1)
s.eg.Go(func() error {
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s.MultiSearchByID/errgroup.Go/id-%d", apiName, idx))
ctx, sspan := trace.StartSpan(ctx, fmt.Sprintf("%s/%s/errgroup.Go/id-%d", apiName, vald.MultiSearchByIDRPCName, idx))
defer func() {
if sspan != nil {
sspan.End()
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/core/ngt/handler/grpc/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (s *server) StreamUpdate(stream vald.Update_StreamUpdateServer) (err error)
func() interface{} { return new(payload.Update_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Update_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamUpdate/id-"+req.GetVector().GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamUpdateRPCName+"/id-"+req.GetVector().GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down
2 changes: 1 addition & 1 deletion pkg/agent/core/ngt/handler/grpc/upsert.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func (s *server) StreamUpsert(stream vald.Upsert_StreamUpsertServer) (err error)
func() interface{} { return new(payload.Upsert_Request) },
func(ctx context.Context, data interface{}) (interface{}, error) {
req := data.(*payload.Upsert_Request)
ctx, sspan := trace.StartSpan(ctx, apiName+".StreamUpsert/id-"+req.GetVector().GetId())
ctx, sspan := trace.StartSpan(ctx, apiName+"/"+vald.StreamUpsertRPCName+"/id-"+req.GetVector().GetId())
defer func() {
if sspan != nil {
sspan.End()
Expand Down

0 comments on commit 8363790

Please # to comment.