Skip to content

Commit

Permalink
core - cleanup split spans
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianZaremba committed Dec 12, 2024
1 parent 61ac5bc commit 1ccf3a1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cbng/processor/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func isVandalism(l *logrus.Entry, parentCtx context.Context, configuration *conf
logger.Tracef("Connecting to %v", coreUrl)

_, scoreSpan := metrics.OtelTracer.Start(ctx, "core.isVandalism.score")
defer scoreSpan.End()
dialer := net.Dialer{Timeout: time.Second * 5}
conn, err := dialer.Dial("tcp", coreUrl)
if err != nil {
Expand Down Expand Up @@ -132,14 +133,14 @@ func isVandalism(l *logrus.Entry, parentCtx context.Context, configuration *conf
break
}
}
defer scoreSpan.End()
scoreSpan.End()
logger = logger.WithField("response", response)

_, scoreDecodeSpan := metrics.OtelTracer.Start(ctx, "core.isVandalism.score.decode")
defer scoreDecodeSpan.End()
editSet := model.WPEditScoreSet{}
if err := xml.Unmarshal(response, &editSet); err != nil {
scoreSpan.SetStatus(codes.Error, err.Error())
scoreDecodeSpan.SetStatus(codes.Error, err.Error())
logger.Warnf("Could not decode response: %v", err)
return false, err
}
Expand Down

0 comments on commit 1ccf3a1

Please sign in to comment.