[VOL-3141] Created Span for various Openflow and Ofagent operations
Change-Id: I49e371479edc087dcf89bd60b43c000ab0bb5547
diff --git a/internal/pkg/ofagent/packetOut.go b/internal/pkg/ofagent/packetOut.go
index d4b6a73..c8bd299 100644
--- a/internal/pkg/ofagent/packetOut.go
+++ b/internal/pkg/ofagent/packetOut.go
@@ -25,6 +25,9 @@
)
func (ofa *OFAgent) streamPacketOut(ctx context.Context) {
+ span, ctx := log.CreateChildSpan(ctx, "stream-packet-out")
+ defer span.Finish()
+
logger.Debug(ctx, "packet-out-started")
// If we exit, assume disconnected
defer func() {
@@ -36,7 +39,7 @@
return
}
opt := grpc.EmptyCallOption{}
- streamCtx, streamDone := context.WithCancel(context.Background())
+ streamCtx, streamDone := context.WithCancel(log.WithSpanFromContext(context.Background(), ctx))
outClient, err := ofa.volthaClient.Get().StreamPacketsOut(streamCtx, opt)
defer streamDone()
if err != nil {