Граф коммитов

41 Коммитов

Автор SHA1 Сообщение Дата
QxBytes ff0c3ea315
fix: move bufio reader creation out of for loop to fix telemetry unmarshal errors (#2789)
* move bufio reader creation out of for loop

if the bufio reader is created in the for loop we get unmarshaling errors

* fix linter issue

* add fixed ut

* fix existing unit test flake due to closing pipe on error

a previous fix ensured the socket closed on error, but this caused an existing ut to nondeterministically fail
without the previous fix, the socket wouldn't have been closed on error

* make read inline
2024-06-21 18:42:27 +00:00
QxBytes 48801a1f6e
fix: close connection on any return from azure-vnet-telemetry (#2711)
* move error handling code to defer

* invert conditional

* address linter issues

* add close connection on telemetry unmarshal error unit test

* Revert "add close connection on telemetry unmarshal error unit test"

This reverts commit e8447f9d0d.
2024-04-29 19:37:31 +00:00
Behzad Mirkhanzadeh c4fe3a8fa7
feat: Dev stateless cni (#2276)
* feat: 🌈 StatelessCNI: Adding getEndpoint and UpdateEndpoint API to CNS (#2102)

* Adding getEndpoint and UpdateEndpoint API to CNS with the respective clients in support of stateless CNI.

* Updating the unit tests and address the comments.

* Addressing the comments.

* Addressing the coments regarding CNS support for Stateless CNI

* Adddressing the PR comments

* 🌈 feat: adding flags for stateless cni (#2103)

feat: stateless cni

* 🌈 feat: StatelessCNI: Applying stateless CNI mode changes in network package. (#2197)

* Apllying stateless CNI mode in network package.

* Addresing the commetns.

* feat: create stateless cni binary for swift (#2275)

* enabling CNS telemetry

* Master rebase changes

* CNI Telemetry enabled on CNS

* Stateless CNI changes.

* making change to CNSendpointStorePath

* Updating makefile to avoid creating statless CNI release.

---------

Co-authored-by: Vipul Singh <vipul21sept@gmail.com>
2023-12-12 00:15:54 +00:00
Paul Yu ae37d40982
[CNI] zap logger for platform package (#2233)
* zap logger for platform package
2023-10-13 12:08:58 -07:00
Paul Yu ae0c08c9d7
[CNI] zap logger telemetry package (#2266)
* zap logger telemetry package
2023-10-04 11:43:46 -07:00
John Payne 7546aacf69
fix: [Telemetry] Prevent telemetry connect if no binary path (#1883)
* Prevent telemetry connect if no binary path

* agnostic calls, addressing comments

* agnostic calls, addressing comments

* Correcting flow, lint

* Restoring aiwrapper

* lint error 113 cleanup

* addressing comments

* cleaning up telemetry folder error calls

* addressing comments

* addressing comments

* addressing comments

---------

Co-authored-by: jpayne3506 <johnpayne@microsoft.com>
Co-authored-by: tamilmani1989 <tamanoha@microsoft.com>
2023-04-07 09:30:54 -07:00
Behzad Mirkhanzadeh 667af455d4
Revert "fix: Adding a defer func to connecttoTelemetryservice() to prevent CNI fro…" (#1819)
* Revert "fix: Adding a defer func to connecttoTelemetryservice() to prevent CNI fro… (#1800)"

This reverts commit 879b6441c9.

* Revert "fix: repair windows cni lock issue (#1712)"

This reverts commit 7b647be285.

* mend
2023-02-24 19:06:24 +00:00
Behzad Mirkhanzadeh 879b6441c9
fix: Adding a defer func to connecttoTelemetryservice() to prevent CNI fro… (#1800)
* Adding a defer func to connecttoTelemetryservice() to prevent CNI from stucking in case of telemetry service failure.

* fix: addressing the comments for telemetry defer function.

* fix: addressing the comments for telemetry defer func.
2023-02-11 22:47:46 +00:00
Behzad Mirkhanzadeh 7b647be285
fix: repair windows cni lock issue (#1712)
* Moving the lock from InitializeKeyValueStore() function to restore/save functions to improve cni performance on windows.

* fix: use defer function to unlock statefile.

* fix: fixing the IPAM lock and defer func

* fix: Optimizing cni file lock by moving SetSdnRemoteArpMacAddress() on startup for CRD and MultitenantCRD mode.

* adding store lock on telemetry service start to avoid race condition on windows.
2023-01-07 08:03:09 +00:00
tamilmani1989 ba3bbe0f26
Remove azure-vnet-telemetry for windows multitenancy (#1430)
* 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
2022-07-01 15:09:39 -07:00
Eng Zer Jun e812bc82b8
refactor: move from io/ioutil to io and os packages (#1096)
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-11-17 16:31:42 -06:00
tamilmani1989 cdab7d0241
Use Lockedfile api to acquire lock (#1070)
* added lockedfileapi support for CNI

* fixed interface changes

* addressed comments
fixed ut

* addressed comments

* fixed copy to buffer part in writer api

* fixed copy to buffer part in writer api

* keeping old code not changing it.
2021-11-09 08:19:44 -08:00
tamilmani1989 35fb886db9
Remove dead codes from telemetry package (#1004) (#1022)
Co-authored-by: JungukCho <jungukcho@microsoft.com>
2021-09-20 13:49:08 -05:00
Evan Baker 1087201b28
chore: appease the linter, pt 2 of ? (#925) 2021-09-01 18:28:17 -05:00
Evan Baker 45f3668401
chore: appease the linter, pt 1 of ? (#922) 2021-07-08 13:30:59 -05:00
Jaeryn 8acc37d6eb
Removing telemetry processed on HostNetAgent (#903)
Co-authored-by: Jaeryn <tsun.chu@microsoft.com>
2021-06-21 13:22:44 -07:00
tamilmani1989 98f838ef1b
Write to intermediate file before moving to state file (#755)
* write to temp file and move to state file

* fixed memleak and other issues

* call windows replace function with MOVEFILE_WRITE_THROUGH flag

* moved few functions to platform package

* moved test files to correct dir

* addressed comments
2021-01-07 17:43:33 -08:00
tamilmani1989 2d619b78fe
AppInsightTelemetry support for CNI (#458)
* 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
2020-01-14 14:53:24 -08:00
tamilmani1989 e0605e90f6
added application insights telemetry package to send metrics and logs (#421)
* added application insights telemetry package to send metrics and logs to appinsights

* moved a function common to both packages
acquired a lock before writing to file

* added read write lock as per chandan comment. Addressed jaeryn comments

* fixed telemetry unit test

* defined interface and added appinsights package as vendor to acn

* added vendor package.go(appinsights)

* dependencies of appinsights

* added AI dependencies

* updated unit tests

* addressed review comments
2019-10-16 13:08:42 -07:00
Yongli Chen f6bff8e3af
change telemetry to message queue and add npm (#366)
* 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
2019-06-19 14:08:35 -07:00
jaer-tsun 9d8a2804fc
Lowering telemetry buffer (maxy payload) size to 4096.) (#338) 2019-04-17 14:20:50 -07:00
jaer-tsun 3043dc9736
CNS to start telemetry process and connect to it (#324)
* Spawn telemetry buffer in a separate process instead of goroutine.

* Adding an option to disable telemetry.

* Addressing some of Tamilmani's comments.
2019-04-08 16:20:05 -07:00
tamilmani1989 a11d5104a0
Config support for Telemetry service (#317)
* 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
2019-03-25 14:12:32 -07:00
tamilmani1989 83945fd6bf
fixed logging part of telemetry (#312)
* fixed logging part of telemetry

* fixed an issue

* added more test coverage

* fixed an issue

* fixed invalid condition and added UT

* initialize telemetry logger as part of telemetry server

* changed checkifsockexists to sockexists

* changed interval time to push telemetry data to host
2019-03-13 14:01:30 -07:00
tamilmani1989 159cd855cb
Added UT in telemetry code to fix code coverage (#310)
* added UT to fix code coverage

* added check before closing client connection

* replaced fmt.Printf with t.Errorf

* Calling cancel to exit server thread and close connection

* updated comments

* fixed an issue in telemtry server code if server closes client connection before

* fixed removing tb connection from array

* removed dead code

* removed duplicate logs

* added a check for removing element from tb.connections

* added mutex lock as multiple threads accessing tb.connections slice

* moved the condition before client close

* added one more UT to fix code coverage

* fixed the ut. shud not write after close
2019-03-11 18:21:50 -07:00
jaer-tsun 3611fcf783 Reset tb connections (#308)
* Limiting the size of our buffered payload to ~2MB

* Clearing/resetting connections slice in telemetry buffer.
2019-02-28 17:10:22 -08:00
tamilmani1989 4be2f9288a
Close telemetry socket when its done (#302)
* 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
2019-02-28 11:32:40 -08:00
jaer-tsun 6276bfce19
Limit telemetry payload size to 65K (#303)
* Limiting the size of our buffered payload to ~2MB

* Modifying payload cap from 2MB to 65535 bytes.

* Modifying how we cap payload size.
2019-02-28 08:29:05 -08:00
jaer-tsun 67debca901
Add ability in CNS to setup networking for a docker container (#298)
* Limiting the size of our buffered payload to ~2MB

* CNI Update operation support

* Adding APIs for attach/detach network container to/from network.

* Updating new apis.

* Addressing Tamilmani's review/comments.

* Renaming Batch APIs and Request members for better clarity.

* Adding check for pluginsSection length before accessing element.

* Renaming ConfigureNetworkContainerNetworkingRequest to ConfigureContainerNetworkRequest.

* Adding default k8s cni paths for windows.

* Adding AzureFirstParty orchestrator type and Basic container type.

* Addressing Sushant's comments.
2019-02-26 16:04:27 -08:00
jaer-tsun e5f6b0d03c
Update host machine ip (#300)
* Limiting the size of our buffered payload to ~2MB

* Changing IPs for calls to host machines from 169.254.169.254 to 168.63.129.16.
2019-02-26 16:03:29 -08:00
jaer-tsun a0d2e2dd1f
Limiting the size of our buffered payload to ~2MB (#284)
* Limiting the size of our buffered payload to ~2MB

* Instead of dropping the oldest reports, we decided to ignore the latest ones.
2019-02-14 15:08:36 -08:00
Tamilmani Manoharan 7eb2391ff2 addressed review comments and added separate logger for telemetry service 2019-02-06 17:05:01 -08:00
Tamilmani Manoharan bff9bed007 addressed review comments and modified unit tests 2019-02-05 15:14:44 -08:00
Tamilmani Manoharan 878e0fd64e added version field. no need to append to tags 2019-02-01 16:31:14 -08:00
Tamilmani Manoharan 4055fa9f51 Added support for CNI telmetry report to mds 2019-02-01 16:24:45 -08:00
Tamilmani Manoharan 281d83e00e saving work 2019-01-24 15:51:32 -08:00
Tamilmani Manoharan d04d6bd9ed added new fields for telemetry 2019-01-23 17:10:29 -08:00
Tamilmani Manoharan 63a4d0f469 temp changes 2019-01-22 17:07:32 -08:00
Tamilmani Manoharan 0ac1ea6f92 telemetry changes 2019-01-14 15:04:17 -08:00
jaer-tsun 136f03caf7 Cns telemetry (#275)
Adds telemetry capability for CNS.
2018-12-12 10:45:48 -08:00
jaer-tsun e6000f2894
Adding telemetry buffer. (#270)
* Adding telemetry buffer.

* Addressing Ashvin's comments.

* Adding changes to cleanup linux socket after programme fails to close.
2018-12-06 09:31:57 -08:00