[VOL-3141] Created Span for various Openflow and Ofagent operations
Change-Id: I49e371479edc087dcf89bd60b43c000ab0bb5547
diff --git a/internal/pkg/openflow/group.go b/internal/pkg/openflow/group.go
index 425e99b..99d12b7 100644
--- a/internal/pkg/openflow/group.go
+++ b/internal/pkg/openflow/group.go
@@ -26,6 +26,8 @@
)
func (ofc *OFConnection) handleGroupMod(ctx context.Context, groupMod ofp.IGroupMod) {
+ span, ctx := log.CreateChildSpan(ctx, "openflow-group-modification")
+ defer span.Finish()
volthaClient := ofc.VolthaClient.Get()
if volthaClient == nil {
@@ -44,7 +46,7 @@
},
}
- _, err := volthaClient.UpdateLogicalDeviceFlowGroupTable(context.Background(), groupUpdate)
+ _, err := volthaClient.UpdateLogicalDeviceFlowGroupTable(log.WithSpanFromContext(context.Background(), ctx), groupUpdate)
if err != nil {
logger.Errorw(ctx, "Error updating group table",
log.Fields{"device-id": ofc.DeviceID, "error": err})