diff --git a/cni/network/plugin/main.go b/cni/network/plugin/main.go index ca69f0a31f..13e20fe522 100644 --- a/cni/network/plugin/main.go +++ b/cni/network/plugin/main.go @@ -60,10 +60,11 @@ func main() { Report: &telemetry.Report{}, } + reportManager.GetReport(pluginName, config.Version) + reportManager.Report.Context = "AzureCNI" + if !reportManager.Report.GetReportState() { log.Printf("GetReport state file didn't exist. Setting flag to true") - reportManager.GetReport(pluginName, config.Version) - reportManager.Report.Context = "AzureCNI" err = reportManager.SendReport() if err != nil { @@ -100,4 +101,13 @@ func main() { if err != nil { os.Exit(1) } + + // Report CNI successfully finished execution. + reportManager.Report.CniSucceeded = true + err = reportManager.SendReport() + if err != nil { + log.Printf("SendReport failed due to %v", err) + } else { + markSendReport(reportManager) + } } diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index 69b3c08962..4a24d8d5b8 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -149,7 +149,7 @@ func (reportMgr *ReportManager) SendReport() error { log.Printf("Going to send Telemetry report to hostnetagent %v", reportMgr.HostNetAgentURL) - log.Printf(`"Start Flag %v CniSucceeded %t Name %v Version %v ErrorMessage %v vnet %v + log.Printf(`"Start Flag %t CniSucceeded %t Name %v Version %v ErrorMessage %v vnet %v Context %v SubContext %v"`, reportMgr.Report.StartFlag, reportMgr.Report.CniSucceeded, reportMgr.Report.Name, reportMgr.Report.Version, reportMgr.Report.ErrorMessage, reportMgr.Report.VnetAddressSpace, reportMgr.Report.Context, reportMgr.Report.SubContext)