[VOL-3141] Enhance Context with OpenTracing Span
Change-Id: I966e235ec5fcb70812f75b98a97aa65dba8c04a2
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index 7c5d86d..3d928c4 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -1583,7 +1583,7 @@
"flow": *deviceFlow,
"device-id": f.deviceHandler.device.Id,
"intf-id": intfID})
- _, err := f.deviceHandler.Client.FlowAdd(context.Background(), deviceFlow)
+ _, err := f.deviceHandler.Client.FlowAdd(log.WithSpanFromContext(context.Background(), ctx), deviceFlow)
st, _ := status.FromError(err)
if st.Code() == codes.AlreadyExists {
@@ -1624,7 +1624,7 @@
log.Fields{
"flow": *deviceFlow,
"device-id": f.deviceHandler.device.Id})
- _, err := f.deviceHandler.Client.FlowRemove(context.Background(), deviceFlow)
+ _, err := f.deviceHandler.Client.FlowRemove(log.WithSpanFromContext(context.Background(), ctx), deviceFlow)
if err != nil {
if f.deviceHandler.device.ConnectStatus == common.ConnectStatus_UNREACHABLE {
logger.Warnw(ctx, "can-not-remove-flow-from-device--unreachable",
@@ -1830,7 +1830,7 @@
log.Fields{
"msg": *delGemPortMsg,
"device-id": f.deviceHandler.device.Id})
- if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(context.Background(),
+ if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
delGemPortMsg,
ic.InterAdapterMessageType_DELETE_GEM_PORT_REQUEST,
f.deviceHandler.device.Type,
@@ -1871,7 +1871,7 @@
log.Fields{
"msg": *delTcontMsg,
"device-id": f.deviceHandler.device.Id})
- if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(context.Background(),
+ if sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
delTcontMsg,
ic.InterAdapterMessageType_DELETE_TCONT_REQUEST,
f.deviceHandler.device.Type,
@@ -2806,7 +2806,7 @@
log.Fields{
"groupToOlt": group,
"command": group.Command})
- _, err := f.deviceHandler.Client.PerformGroupOperation(context.Background(), group)
+ _, err := f.deviceHandler.Client.PerformGroupOperation(log.WithSpanFromContext(context.Background(), ctx), group)
if err != nil {
return olterrors.NewErrAdapter("group-operation-failed", log.Fields{"groupToOlt": group}, err)
}
@@ -2878,7 +2878,7 @@
tpPath := f.getTPpath(ctx, intfID, uni, TpID)
tpDownloadMsg := &ic.InterAdapterTechProfileDownloadMessage{UniId: uniID, Path: tpPath}
logger.Debugw(ctx, "sending-load-tech-profile-request-to-brcm-onu-adapter", log.Fields{"tpDownloadMsg": *tpDownloadMsg})
- sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(context.Background(),
+ sendErr := f.deviceHandler.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx),
tpDownloadMsg,
ic.InterAdapterMessageType_TECH_PROFILE_DOWNLOAD_REQUEST,
f.deviceHandler.device.Type,