* fix log on ai telemetry handle create error
* fix failure to pass cni ai id at build time for cni images
* address feedback
* move ai id to hardcoded variable
* update unit test
* Revert "move ai id to hardcoded variable"
This reverts commit 666c2b0a8f.
* fix typo
* feat: added logger package and replaced old log initialization for the new one
* feat: changed all log lines to new zap logger
* fix: typo
* Update azure-ipam/logger/logger.go
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
* fix: adding constants to describe logger rotations constraints
* Renamed logger New method
* Replaced logAndSend method by log 1st and send then so we can use zap fields
* minor fixes
* added logger init for tests
* replaced Any by Error
* gci ipam_test
* fixed govet errors
* moved component to a zap field
* fixed linit issues
* added log mock
* fix: gci
* fix: added context for logger teardown
* Update cni/log/logger.go
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* moved logger init mock function
* fix: lint findings
---------
Co-authored-by: Esteban Capillo <estebancams@microsoft.com>
Co-authored-by: Timothy J. Raymond <timraymond@users.noreply.github.com>
Co-authored-by: Evan Baker <rbtr@users.noreply.github.com>
* Remove azure-vne-telemetry for windows multitenancy and telemetry service for windows multitenancy will be started from cns.
* start telemetry service from cns
* lint and log fix
* minor change
* addressed comment
log.SetTarget creates the log file under log directory using golang os package. Whenever code sets the log directory, it needed to call SetTarget to create the actual log file under that directory. In the recent logger changes, InitLogger by default set the log directory to the current folder. This created the log file in the current folder. The code then set the log directory to a different location without a subsequent call to log.SetTarget. This resulted into the logger to not find the actual log file in the set log directory.
This fix updates the logger InitLogger function to accept the log directory to create the file in correct log directory. To avoid having such issue, this fix also combines the function calls to set log directory and set target into a single function. This prevents any out of order calls resulting into such issue.
* Added AITelemetry support for CNI
* added new files
* added other configs in config file
* fixed ut
* updated disableall similar to cns
* added container name to report
* addressed review comments
* addressed review comments
* added check for azure environment
* added log
* close log handle in unit test
* addressed review comments
* addressed review comments
* fixed a condition
* keep the netagent channel for logs
* fixed error
* addressed review comments
* change telemetry to message queue and add npm
* remove [Azure-NPM] prefix
* remove npmreport url
* fair scheduling
* holds up to 1k reports for each type
* fix cap on reports
* 1. Start telemetry service as separate process for all components cns/networkmonitor
2. Added telemetry config through which we can configure reportTohost interval
3. Added unit tests for changes
* added new files for telemetry testing
* added tests for invalid cases
* updated with dummy subid
* 1. fix for closing telemetry socket in cni
2. fix for closing connection socket if server receives error on read
* added uts and addressed comments
* removed from slice after closing connection