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

80 Коммитов

Автор SHA1 Сообщение Дата
QxBytes 846ed20f81 remove stutter 2024-11-19 12:16:04 -08:00
QxBytes 27832a148e address feedback 2024-11-19 12:00:10 -08:00
QxBytes 787eaef8d3 refactor plugin main
remove reflect
remove duplicated telemetry and telemetry buffer
remove unused fields in report manager
force access to telemetry client fields through methods
move telemetry start/connect code closer to start of plugin execution
2024-11-18 11:50:46 -08:00
QxBytes fd76e5a7eb replace nwcfg subcontext with containerid for correlation 2024-11-11 15:37:45 -08:00
QxBytes 77de27f890 add new telemetry logs for debugging 2024-11-11 02:59:35 -08:00
Alexander 7f0339a294
fix: pass ai metadata to telemetry during cni image build (#3095)
* 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
2024-11-04 21:39:37 +00:00
QxBytes fc4da42d66
refactor: create safer command execution method (#2899)
* rename ExecuteCommand to ExecuteRawCommand

* add safer execute command method

* fix windows platform command test

* add uts and comments

* address feedback

* add parent context to execute command
2024-08-06 21:36:55 +00:00
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
Camryn Lee f4d1c9b451
fix: unblock channel for cni (#1667)
* implement select case

* remove calls to tb.cancel() in telemetry.go
2022-10-24 13:16:27 -07: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
tamilmani1989 1c26dfc7fe
chore: Log CNI events to kusto for debugging (#1193)
* sending cni critical events to kusto

* lint fix

* addressing comments
2022-01-25 09:44:51 -08: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 279911c94a
Support for Dualstack transparent (#1046)
* ipv6 dualstack support transparent mode

* golint fixes

* fixed linter errors

* enable ipv6 setting

* dualstack transparent changes

* abstracted platform execute command

* lint fixes
fix compilation issues

* addressed comments

* fixed a bug
2021-10-15 14:28:37 -07:00
tamilmani1989 30b1de2218
chore: Refactor UTs in telemetry packages (#1011) (#1024)
* Refactor UTs to cleanup UTs and increase UT coverages

* User assert for consistency

* Applied comments and resolve lint error

* Delete unnecessary license header

Co-authored-by: JungukCho <jungukcho@microsoft.com>
2021-09-20 13:55:21 -05: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
JungukCho 3817a98350
Remove dead codes in NPM-related metrics from telemetry and NPM (#999) 2021-09-14 09:38:58 -07:00
Evan Baker 96bec09d41
chore: appease the linter (3/?), the big gofumpt (#987)
* gofumpt -w -s .

* small addtl cleanups after gofumpt

* rerun after rebase
2021-09-02 16:33:18 -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
Paul Johnston 11f2d74a7c
Removing execution time metric (#566) 2020-05-20 17:10:49 -07:00
tamilmani1989 d2ea35d079
fixing race in telemetry test code (#565) 2020-05-19 15:37:38 -07:00
Paul Johnston 6e1827d83d
Fix cni logs (#548)
* Added else if to catch empty messages

* Stopped sending empty messages to AI telemetry for CNI

* Removing cni prefix from log messages

* Reverting go.sum change back to what it was before

* Adding check for empty messages before sending metric

* Moving empty message check before cnimetric initialization
2020-04-30 11:21:45 -07:00
tamilmani1989 6ac5e8c9f0
CNI Ipv6 Dualstack Support (#538)
* added cniv6 plugin

* cni ipv6 base framework

* removed unwanted changes

* added ipv6 change

* added cni ipv6 changes

* drop neighbor discovery messages to other VMs

* fixed issues

* fixed unit tests

* fix nil dereference

* addressed comments

* ipv6 fixes and changes

* addressed comments
2020-04-15 22:30:48 -07:00
tamilmani1989 a151c83894
AITelemetry support for CNS (#455)
* Added logger package for CNS

* added aitelemetry for cns

* Added AI Telemetry for CNS

* added respective folders in makefile and added config file

* added all config fields

* addressed review comments

* removing repetitive log

* logged configpath

* reverted to keep old telemetry channel and pulled new ai package

* removed unwanted logs..added log file
2020-01-24 13:29:52 -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
jaer-tsun fccf269d1b
Adding container type field. (#389) 2019-08-12 14:57:42 -07:00
jaer-tsun 76cab93c2b
Adding new fields in DNCReport. (#385) 2019-08-02 13:06:27 -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
tamilmani1989 a75fbe77b3 Set dns server on azure bridge for ubuntu version >= 17 (#345)
* configure dns server on azure bridge for ubuntu versions > 18. Moved hns related apis from platform package to hsnclient package

* read dns server from interface instead of file and fixed few issues

* renturn error on fail to configure dns

* added unitest and fixed an issue in ReadFileByLines method

* added a UT

* addressed comments and added few tests to get code coverage

* confiure dns for ubuntu17 also

* corrected typo error of filename
2019-04-30 16:27:48 -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