[VOL-3141] Created Span for various Openflow and Ofagent operations
Change-Id: I49e371479edc087dcf89bd60b43c000ab0bb5547
diff --git a/internal/pkg/ofagent/packetIn.go b/internal/pkg/ofagent/packetIn.go
index 2a49e94..4d28410 100644
--- a/internal/pkg/ofagent/packetIn.go
+++ b/internal/pkg/ofagent/packetIn.go
@@ -31,6 +31,9 @@
)
func (ofa *OFAgent) receivePacketsIn(ctx context.Context) {
+ span, ctx := log.CreateChildSpan(ctx, "receive-packets-in")
+ defer span.Finish()
+
logger.Debug(ctx, "receive-packets-in-started")
// If we exit, assume disconnected
defer func() {
@@ -42,7 +45,7 @@
return
}
opt := grpc.EmptyCallOption{}
- streamCtx, streamDone := context.WithCancel(context.Background())
+ streamCtx, streamDone := context.WithCancel(log.WithSpanFromContext(context.Background(), ctx))
defer streamDone()
stream, err := ofa.volthaClient.Get().ReceivePacketsIn(streamCtx, &empty.Empty{}, opt)
if err != nil {
@@ -70,6 +73,9 @@
}
func (ofa *OFAgent) handlePacketsIn(ctx context.Context) {
+ span, ctx := log.CreateChildSpan(ctx, "handle-packets-in")
+ defer span.Finish()
+
logger.Debug(ctx, "handle-packets-in-started")
top:
for {