[VOL-3141] Enhance Context with OpenTracing Span
Change-Id: I966e235ec5fcb70812f75b98a97aa65dba8c04a2
diff --git a/VERSION b/VERSION
index f225a78..0faf113 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-2.5.2
+2.5.3-dev
diff --git a/cmd/openolt-adapter/main.go b/cmd/openolt-adapter/main.go
index 14c47d2..ee41299 100644
--- a/cmd/openolt-adapter/main.go
+++ b/cmd/openolt-adapter/main.go
@@ -395,7 +395,7 @@
deviceTypes := &voltha.DeviceTypes{Items: types}
count := 0
for {
- if err := a.coreProxy.RegisterAdapter(context.TODO(), adapterDescription, deviceTypes); err != nil {
+ if err := a.coreProxy.RegisterAdapter(log.WithSpanFromContext(context.TODO(), ctx), adapterDescription, deviceTypes); err != nil {
logger.Warnw(ctx, "registering-with-core-failed", log.Fields{"error": err})
if retries == count {
return err
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index f735e27..504526f 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -271,9 +271,9 @@
return olterrors.NewErrNotFound("port-label", log.Fields{"port-number": portNum, "port-type": portType}, err)
}
- if port, err := dh.coreProxy.GetDevicePort(context.TODO(), dh.device.Id, portNum); err == nil && port.Type == portType {
+ if port, err := dh.coreProxy.GetDevicePort(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, portNum); err == nil && port.Type == portType {
log.Debug(ctx, "port-already-exists-updating-oper-status-of-port")
- if err := dh.coreProxy.PortStateUpdate(context.TODO(), dh.device.Id, portType, portNum, operStatus); err != nil {
+ if err := dh.coreProxy.PortStateUpdate(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, portType, portNum, operStatus); err != nil {
return olterrors.NewErrAdapter("failed-to-update-port-state", log.Fields{
"device-id": dh.device.Id,
"port-type": portType,
@@ -302,7 +302,7 @@
}
logger.Debugw(ctx, "sending-port-update-to-core", log.Fields{"port": port})
// Synchronous call to update device - this method is run in its own go routine
- if err := dh.coreProxy.PortCreated(context.TODO(), dh.device.Id, port); err != nil {
+ if err := dh.coreProxy.PortCreated(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, port); err != nil {
return olterrors.NewErrAdapter("error-creating-port", log.Fields{
"device-id": dh.device.Id,
"port-type": portType}, err)
@@ -314,7 +314,7 @@
func (dh *DeviceHandler) updateLocalDevice(ctx context.Context) {
dh.lockDevice.Lock()
defer dh.lockDevice.Unlock()
- device, err := dh.coreProxy.GetDevice(context.TODO(), dh.device.Id, dh.device.Id)
+ device, err := dh.coreProxy.GetDevice(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, dh.device.Id)
if err != nil || device == nil {
logger.Errorf(ctx, "device-not-found", log.Fields{"device-id": dh.device.Id}, err)
return
@@ -481,10 +481,16 @@
raisedTs := time.Now().UnixNano()
switch indication.Data.(type) {
case *oop.Indication_OltInd:
+ span, ctx := log.CreateChildSpan(ctx, "olt-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
if err := dh.handleOltIndication(ctx, indication.GetOltInd()); err != nil {
_ = olterrors.NewErrAdapter("handle-indication-error", log.Fields{"type": "olt", "device-id": dh.device.Id}, err).Log()
}
case *oop.Indication_IntfInd:
+ span, ctx := log.CreateChildSpan(ctx, "interface-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
intfInd := indication.GetIntfInd()
go func() {
if err := dh.addPort(ctx, intfInd.GetIntfId(), voltha.Port_PON_OLT, intfInd.GetOperState()); err != nil {
@@ -493,6 +499,9 @@
}()
logger.Infow(ctx, "received-interface-indication", log.Fields{"InterfaceInd": intfInd, "device-id": dh.device.Id})
case *oop.Indication_IntfOperInd:
+ span, ctx := log.CreateChildSpan(ctx, "interface-oper-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
intfOperInd := indication.GetIntfOperInd()
if intfOperInd.GetType() == "nni" {
go func() {
@@ -517,6 +526,9 @@
log.Fields{"interfaceOperInd": intfOperInd,
"device-id": dh.device.Id})
case *oop.Indication_OnuDiscInd:
+ span, ctx := log.CreateChildSpan(ctx, "onu-discovery-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
onuDiscInd := indication.GetOnuDiscInd()
logger.Infow(ctx, "received-onu-discovery-indication", log.Fields{"OnuDiscInd": onuDiscInd, "device-id": dh.device.Id})
sn := dh.stringifySerialNumber(onuDiscInd.SerialNumber)
@@ -526,6 +538,9 @@
}
}()
case *oop.Indication_OnuInd:
+ span, ctx := log.CreateChildSpan(ctx, "onu-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
onuInd := indication.GetOnuInd()
logger.Infow(ctx, "received-onu-indication", log.Fields{"OnuInd": onuInd, "device-id": dh.device.Id})
go func() {
@@ -534,6 +549,9 @@
}
}()
case *oop.Indication_OmciInd:
+ span, ctx := log.CreateChildSpan(ctx, "omci-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
omciInd := indication.GetOmciInd()
logger.Debugw(ctx, "received-omci-indication", log.Fields{"intf-id": omciInd.IntfId, "onu-id": omciInd.OnuId, "device-id": dh.device.Id})
go func() {
@@ -542,6 +560,9 @@
}
}()
case *oop.Indication_PktInd:
+ span, ctx := log.CreateChildSpan(ctx, "packet-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
pktInd := indication.GetPktInd()
logger.Debugw(ctx, "received-packet-indication", log.Fields{
"intf-type": pktInd.IntfId,
@@ -568,12 +589,21 @@
}
}()
case *oop.Indication_PortStats:
+ span, ctx := log.CreateChildSpan(ctx, "port-statistics-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
portStats := indication.GetPortStats()
go dh.portStats.PortStatisticsIndication(ctx, portStats, dh.resourceMgr.DevInfo.GetPonPorts())
case *oop.Indication_FlowStats:
+ span, ctx := log.CreateChildSpan(ctx, "flow-stats-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
flowStats := indication.GetFlowStats()
logger.Infow(ctx, "received-flow-stats", log.Fields{"FlowStats": flowStats, "device-id": dh.device.Id})
case *oop.Indication_AlarmInd:
+ span, ctx := log.CreateChildSpan(ctx, "alarm-indication", log.Fields{"device-id": dh.device.Id})
+ defer span.Finish()
+
alarmInd := indication.GetAlarmInd()
logger.Infow(ctx, "received-alarm-indication", log.Fields{"AlarmInd": alarmInd, "device-id": dh.device.Id})
go dh.eventMgr.ProcessEvents(ctx, alarmInd, dh.device.Id, raisedTs)
@@ -716,7 +746,7 @@
return nil
}
- ports, err := dh.coreProxy.ListDevicePorts(context.TODO(), dh.device.Id)
+ ports, err := dh.coreProxy.ListDevicePorts(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id)
if err != nil {
/*TODO: needs to handle error scenarios */
return olterrors.NewErrAdapter("fetch-ports-failed", log.Fields{"device-id": dh.device.Id}, err)
@@ -775,7 +805,7 @@
var err error
var deviceInfo *oop.DeviceInfo
- deviceInfo, err = dh.Client.GetDeviceInfo(context.Background(), new(oop.Empty))
+ deviceInfo, err = dh.Client.GetDeviceInfo(log.WithSpanFromContext(context.Background(), ctx), new(oop.Empty))
if err != nil {
return nil, olterrors.NewErrPersistence("get", "device", 0, nil, err)
@@ -806,7 +836,7 @@
}
// Synchronous call to update device - this method is run in its own go routine
- if err := dh.coreProxy.DeviceUpdate(context.TODO(), dh.device); err != nil {
+ if err := dh.coreProxy.DeviceUpdate(log.WithSpanFromContext(context.TODO(), ctx), dh.device); err != nil {
return nil, olterrors.NewErrAdapter("device-update-failed", log.Fields{"device-id": dh.device.Id}, err)
}
@@ -822,7 +852,7 @@
return
case <-time.After(time.Duration(dh.metrics.ToPmConfigs().DefaultFreq) * time.Second):
- ports, err := dh.coreProxy.ListDevicePorts(context.Background(), dh.device.Id)
+ ports, err := dh.coreProxy.ListDevicePorts(log.WithSpanFromContext(context.Background(), ctx), dh.device.Id)
if err != nil {
logger.Warnw(ctx, "failed-to-list-ports", log.Fields{"device-id": dh.device.Id, "error": err})
continue
@@ -907,7 +937,7 @@
kwargs["onu_id"] = omciInd.OnuId
kwargs["parent_port_no"] = ponPort
- onuDevice, err := dh.coreProxy.GetChildDevice(context.TODO(), dh.device.Id, kwargs)
+ onuDevice, err := dh.coreProxy.GetChildDevice(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, kwargs)
if err != nil {
return olterrors.NewErrNotFound("onu", log.Fields{
"intf-id": omciInd.IntfId,
@@ -927,7 +957,7 @@
}
omciMsg := &ic.InterAdapterOmciMessage{Message: omciInd.Pkt}
- if err := dh.AdapterProxy.SendInterAdapterMessage(context.Background(), omciMsg,
+ if err := dh.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.Background(), ctx), omciMsg,
ic.InterAdapterMessageType_OMCI_REQUEST, dh.device.Type, deviceType,
deviceID, proxyDeviceID, ""); err != nil {
return olterrors.NewErrCommunication("omci-request", log.Fields{
@@ -961,7 +991,7 @@
}
if omciMsg.GetProxyAddress() == nil {
- onuDevice, err := dh.coreProxy.GetDevice(context.TODO(), dh.device.Id, toDeviceID)
+ onuDevice, err := dh.coreProxy.GetDevice(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, toDeviceID)
if err != nil {
return olterrors.NewErrNotFound("onu", log.Fields{
"device-id": dh.device.Id,
@@ -981,7 +1011,6 @@
"onu-device-id": toDeviceID}, err)
}
}
-
} else {
return olterrors.NewErrInvalidValue(log.Fields{"inter-adapter-message-type": msg.Header.Type}, nil)
}
@@ -1022,7 +1051,7 @@
logger.Debugw(ctx, "sent-omci-msg", log.Fields{"intf-id": intfID, "onu-id": onuID,
"omciTransactionID": transid, "omciMsg": string(omciMessage.Pkt)})
- _, err := dh.Client.OmciMsgOut(context.Background(), omciMessage)
+ _, err := dh.Client.OmciMsgOut(log.WithSpanFromContext(context.Background(), ctx), omciMessage)
if err != nil {
return olterrors.NewErrCommunication("omci-send-failed", log.Fields{
"intf-id": intfID,
@@ -1055,7 +1084,6 @@
}
func (dh *DeviceHandler) onuDiscIndication(ctx context.Context, onuDiscInd *oop.OnuDiscIndication, sn string) error {
-
channelID := onuDiscInd.GetIntfId()
parentPortNo := IntfIDToPortNo(onuDiscInd.GetIntfId(), voltha.Port_PON_OLT)
@@ -1143,7 +1171,7 @@
"serial-number": sn}, err)
}
- if onuDevice, err = dh.coreProxy.ChildDeviceDetected(context.TODO(), dh.device.Id, int(parentPortNo),
+ if onuDevice, err = dh.coreProxy.ChildDeviceDetected(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, int(parentPortNo),
"", int(channelID), string(onuDiscInd.SerialNumber.GetVendorId()), sn, int64(onuID)); err != nil {
dh.discOnus.Delete(sn)
dh.resourceMgr.FreeonuID(ctx, ponintfid, []uint32{onuID}) // NOTE I'm not sure this method is actually cleaning up the right thing
@@ -1224,7 +1252,7 @@
errFields["onu-id"] = onuInd.OnuId
errFields["parent-port-no"] = ponPort
}
- onuDevice, err = dh.coreProxy.GetChildDevice(context.TODO(), dh.device.Id, kwargs)
+ onuDevice, err = dh.coreProxy.GetChildDevice(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, kwargs)
}
if err != nil || onuDevice == nil {
@@ -1343,7 +1371,7 @@
kwargs := make(map[string]interface{})
kwargs["onu_id"] = onuID
kwargs["parent_port_no"] = parentPort
- onuDevice, err := dh.coreProxy.GetChildDevice(context.TODO(), dh.device.Id, kwargs)
+ onuDevice, err := dh.coreProxy.GetChildDevice(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, kwargs)
if err != nil {
return nil, olterrors.NewErrNotFound("onu-device", log.Fields{
"intf-id": parentPort,
@@ -1364,7 +1392,7 @@
"device-id": dh.device.Id,
})
}
- if err := dh.coreProxy.SendPacketIn(context.TODO(), dh.device.Id, logicalPort, packetPayload); err != nil {
+ if err := dh.coreProxy.SendPacketIn(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, logicalPort, packetPayload); err != nil {
return olterrors.NewErrCommunication("packet-send-failed", log.Fields{
"source": "adapter",
"destination": "core",
@@ -1396,7 +1424,6 @@
// UpdatePmConfig updates the pm metrics.
func (dh *DeviceHandler) UpdatePmConfig(ctx context.Context, pmConfigs *voltha.PmConfigs) {
-
logger.Infow(ctx, "update-pm-configs", log.Fields{"device-id": dh.device.Id, "pm-configs": pmConfigs})
if pmConfigs.DefaultFreq != dh.metrics.ToPmConfigs().DefaultFreq {
@@ -1484,7 +1511,7 @@
/* On device disable ,admin state update has to be done prior sending request to agent since
the indication thread may processes invalid indications of ONU and OLT*/
if dh.Client != nil {
- if _, err := dh.Client.DisableOlt(context.Background(), new(oop.Empty)); err != nil {
+ if _, err := dh.Client.DisableOlt(log.WithSpanFromContext(context.Background(), ctx), new(oop.Empty)); err != nil {
if e, ok := status.FromError(err); ok && e.Code() == codes.Internal {
return olterrors.NewErrAdapter("olt-disable-failed", log.Fields{"device-id": device.Id}, err)
}
@@ -1505,7 +1532,7 @@
//Update device Admin state
dh.device = cloned
// Update the all pon ports state on that device to disable and NNI remains active as NNI remains active in openolt agent.
- if err := dh.coreProxy.PortsStateUpdate(context.TODO(), cloned.Id, ^uint32(1<<voltha.Port_PON_OLT), voltha.OperStatus_UNKNOWN); err != nil {
+ if err := dh.coreProxy.PortsStateUpdate(log.WithSpanFromContext(context.TODO(), ctx), cloned.Id, ^uint32(1<<voltha.Port_PON_OLT), voltha.OperStatus_UNKNOWN); err != nil {
return olterrors.NewErrAdapter("ports-state-update-failed", log.Fields{"device-id": device.Id}, err)
}
logger.Debugw(ctx, "disable-device-end", log.Fields{"device-id": device.Id})
@@ -1513,18 +1540,17 @@
}
func (dh *DeviceHandler) notifyChildDevices(ctx context.Context, state string) {
-
// Update onu state as unreachable in onu adapter
onuInd := oop.OnuIndication{}
onuInd.OperState = state
//get the child device for the parent device
- onuDevices, err := dh.coreProxy.GetChildDevices(context.TODO(), dh.device.Id)
+ onuDevices, err := dh.coreProxy.GetChildDevices(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id)
if err != nil {
logger.Errorw(ctx, "failed-to-get-child-devices-information", log.Fields{"device-id": dh.device.Id, "error": err})
}
if onuDevices != nil {
for _, onuDevice := range onuDevices.Items {
- err := dh.AdapterProxy.SendInterAdapterMessage(context.TODO(), &onuInd, ic.InterAdapterMessageType_ONU_IND_REQUEST,
+ err := dh.AdapterProxy.SendInterAdapterMessage(log.WithSpanFromContext(context.TODO(), ctx), &onuInd, ic.InterAdapterMessageType_ONU_IND_REQUEST,
"openolt", onuDevice.Type, onuDevice.Id, onuDevice.ProxyAddress.DeviceId, "")
if err != nil {
logger.Errorw(ctx, "failed-to-send-inter-adapter-message", log.Fields{"OnuInd": onuInd,
@@ -1542,7 +1568,7 @@
//Device Port-State: ACTIVE
//Device Oper-State: ACTIVE
func (dh *DeviceHandler) ReenableDevice(ctx context.Context, device *voltha.Device) error {
- if _, err := dh.Client.ReenableOlt(context.Background(), new(oop.Empty)); err != nil {
+ if _, err := dh.Client.ReenableOlt(log.WithSpanFromContext(context.Background(), ctx), new(oop.Empty)); err != nil {
if e, ok := status.FromError(err); ok && e.Code() == codes.Internal {
return olterrors.NewErrAdapter("olt-reenable-failed", log.Fields{"device-id": dh.device.Id}, err)
}
@@ -1562,7 +1588,7 @@
device.OperStatus = voltha.OperStatus_ACTIVE
dh.device = device
- if err := dh.coreProxy.DeviceStateUpdate(context.TODO(), device.Id, device.ConnectStatus, device.OperStatus); err != nil {
+ if err := dh.coreProxy.DeviceStateUpdate(log.WithSpanFromContext(context.TODO(), ctx), device.Id, device.ConnectStatus, device.OperStatus); err != nil {
return olterrors.NewErrAdapter("state-update-failed", log.Fields{
"device-id": device.Id,
"connect-status": device.ConnectStatus,
@@ -1670,6 +1696,7 @@
return nil
}
func (dh *DeviceHandler) cleanupDeviceResources(ctx context.Context) {
+
if dh.resourceMgr != nil {
noOfPonPorts := dh.resourceMgr.DevInfo.GetPonPorts()
var ponPort uint32
@@ -1731,7 +1758,7 @@
//RebootDevice reboots the given device
func (dh *DeviceHandler) RebootDevice(ctx context.Context, device *voltha.Device) error {
- if _, err := dh.Client.Reboot(context.Background(), new(oop.Empty)); err != nil {
+ if _, err := dh.Client.Reboot(log.WithSpanFromContext(context.Background(), ctx), new(oop.Empty)); err != nil {
return olterrors.NewErrAdapter("olt-reboot-failed", log.Fields{"device-id": dh.device.Id}, err)
}
logger.Debugw(ctx, "rebooted-device-successfully", log.Fields{"device-id": device.Id})
@@ -1758,7 +1785,7 @@
})
}
- if err := dh.coreProxy.SendPacketIn(context.TODO(), dh.device.Id, logicalPortNum, packetIn.Pkt); err != nil {
+ if err := dh.coreProxy.SendPacketIn(log.WithSpanFromContext(context.TODO(), ctx), dh.device.Id, logicalPortNum, packetIn.Pkt); err != nil {
return olterrors.NewErrCommunication("send-packet-in", log.Fields{
"destination": "core",
"source": dh.device.Type,
@@ -1899,6 +1926,7 @@
}
func startHeartbeatCheck(ctx context.Context, dh *DeviceHandler) {
+
// start the heartbeat check towards the OLT.
var timerCheck *time.Timer
@@ -1906,7 +1934,7 @@
heartbeatTimer := time.NewTimer(dh.openOLT.HeartbeatCheckInterval)
select {
case <-heartbeatTimer.C:
- ctxWithTimeout, cancel := context.WithTimeout(context.Background(), dh.openOLT.GrpcTimeoutInterval)
+ ctxWithTimeout, cancel := context.WithTimeout(log.WithSpanFromContext(context.Background(), ctx), dh.openOLT.GrpcTimeoutInterval)
if heartBeat, err := dh.Client.HeartbeatCheck(ctxWithTimeout, new(oop.Empty)); err != nil {
logger.Warnw(ctx, "hearbeat-failed", log.Fields{"device-id": dh.device.Id})
if timerCheck == nil {
@@ -2099,7 +2127,7 @@
}
onu := &oop.Onu{IntfId: intfID, OnuId: onuID, SerialNumber: sn}
- if _, err := dh.Client.DeleteOnu(context.Background(), onu); err != nil {
+ if _, err := dh.Client.DeleteOnu(log.WithSpanFromContext(context.Background(), ctx), onu); err != nil {
return olterrors.NewErrAdapter("failed-to-delete-onu", log.Fields{
"device-id": dh.device.Id,
"onu-id": onuID}, err).Log()
@@ -2301,13 +2329,13 @@
dh.onus.Store(onuKey, onuDevice)
}
-func (dh *DeviceHandler) getExtValue(device *voltha.Device, value voltha.ValueType_Type) (*voltha.ReturnValues, error) {
+func (dh *DeviceHandler) getExtValue(ctx context.Context, device *voltha.Device, value voltha.ValueType_Type) (*voltha.ReturnValues, error) {
var err error
var sn *oop.SerialNumber
var ID uint32
resp := new(voltha.ReturnValues)
valueparam := new(oop.ValueParam)
- ctx := context.Background()
+ ctx = log.WithSpanFromContext(context.Background(), ctx)
log.Infow("getExtValue", log.Fields{"onu-id": device.Id, "pon-intf": device.ParentPortNo})
if sn, err = dh.deStringifySerialNumber(device.SerialNumber); err != nil {
return nil, err
diff --git a/internal/pkg/core/openolt.go b/internal/pkg/core/openolt.go
index 702a1a2..453b9da 100644
--- a/internal/pkg/core/openolt.go
+++ b/internal/pkg/core/openolt.go
@@ -360,7 +360,7 @@
resp := new(voltha.ReturnValues)
log.Infow("Get_ext_value", log.Fields{"device-id": deviceID, "onu-id": device.Id})
if handler := oo.getDeviceHandler(deviceID); handler != nil {
- if resp, err = handler.getExtValue(device, valueparam); err != nil {
+ if resp, err = handler.getExtValue(ctx, device, valueparam); err != nil {
log.Errorw("error-occurred-during-get-ext-value", log.Fields{"device-id": deviceID, "onu-id": device.Id,
"error": err})
return nil, err
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,