Skip to content

Adding Kusto Telemetry to ApplicationHealthLinux v2 #63

Merged
klugorosado merged 33 commits intofeature/v2/bootstrapVMWatchfrom
feature/v2/bootstrapVMWatch-Telemetry
May 2, 2024
Merged

Adding Kusto Telemetry to ApplicationHealthLinux v2 #63
klugorosado merged 33 commits intofeature/v2/bootstrapVMWatchfrom
feature/v2/bootstrapVMWatch-Telemetry

Conversation

@klugorosado
Copy link
Collaborator

@klugorosado klugorosado commented Apr 18, 2024

Changes

This Pull request contains a series of changes aimed at adding Kusto Telemetry to AppHealthLinux v2, the most significant changes include:

  • Added new Telemetry.go, this file contains our Kusto Telemetry Logic and Setup.
    • Created new LogStdOutAndEventWithSender that returns A function that when used it will log to the event to StdOut then publish the event.
    • Added 7 Type of EventTasks: [Main, AppHealth, AppHealthProbe, AppHealthStatus, VMWatch, VMWatchSetup, VMWatchStatus]
  • Adding Logging package with NopLogger, This Logger is to be used for extension-platform libraries.
  • Replaced most normal StdOut logging from repo and replaced with sendTelemetry function that will do both.
  • Added internal handlerenv and manifest packages from Windows Migration Feature Branch.
  • Updated extension to use Go 1.22.
  • Added manifest.xml to UT containers.
Copilot Summary

Dockerfile and Workflow Modifications:

  • .devcontainer/Dockerfile: Updated the Go version from 1.21-bullseye to 1.18-bullseye.
  • .github/workflows/go.yml: Added steps to set up Bats libraries and test the Bats installation, and changed the continue-on-error value from true to false in the Unit Tests step. [1] [2]

File and Dependency Updates:

  • .vscode/extensions.json: Removed the "golang.go" and "ms-vscode-remote.remote-ssh" extensions, and added the "github.copilot", "ms-azuretools.vscode-docker", and "github.vscode-pull-request-github" extensions.
  • .devcontainer/extension-settings.json: Changed the "requestPath" value from "health" to "/health".
  • go.mod: Updated the module path from "github.com/Azure/run-command-extension-linux" to "github.com/Azure/applicationhealth-extension-linux", and updated several dependencies.

Testing Improvements:

Newly Added Files:

@klugorosado klugorosado added the enhancement New feature or request label Apr 18, 2024
@klugorosado klugorosado self-assigned this Apr 18, 2024
@klugorosado klugorosado marked this pull request as ready for review April 18, 2024 19:45
… like the String() func

- Added String() func to handlersettings struct, publicSettings struct, vmWatchSettings struct and
vmWatchSignalFilters struct
- Added Telemetry Event for HandlerSettings, and for HandlerEnviroment
- Updated HandlerSettings struct String() func to use MarshallIndent
- Fixed Failing UTs due to nil pointer in Embedded Struct inside HandlerEnviroment.
@klugorosado klugorosado merged commit b56f2ad into feature/v2/bootstrapVMWatch May 2, 2024
@klugorosado klugorosado deleted the feature/v2/bootstrapVMWatch-Telemetry branch May 2, 2024 06:46
klugorosado added a commit that referenced this pull request May 15, 2024
* Adding internal/manifest package from Cross-Platform AppHealth Feature Branch

* Running go mod tidy and go mod vendor

* - Add manifest.xml to Extension folder
- Chaged Github workflow go version to Go 1.18
- Small refactor in setup function for bats tests.

* Update Go version to 1.18 in Dockerfile

* Add logging package with NopLogger implementation

* Add telemetry package for logging events

* - Add telemetry event Logging to main.go

* - Add new String() methods to vmWatchSignalFilters and vmWatchSettings structs
- Add telemetry event Logging to handlersettings.go

* - Add telemetry event Logging to reportstatus.go

* Add telemetry event Logging to health.go

* Refactor install handler in main/cmds.go to use telemetry event logging

* Refactor uninstall handler in main/cmds.go to use telemetry event logging

* Refactor enable handler function in main/cmds.go to use telemetry event logging

* Refactor vmWatch.go to use telemetry event logging

* Fix requestPath in extension-settings.json and updated 2 integration tests,  one in 2_handler-commands.bats and another in 7_vmwatch.bats

* ran go mod tidy && go mod vendor

* Update ExtensionManifest version to 2.0.9 on UT

* Refactor telemetry event sender to use EventLevel constants in main/telemetry.go

* Refactor telemetry event sender to use EventTasks constants that match with existing Windows Telemetry

* Update logging messages in 7_vmwatch.bats

* Moved telemetry.go to its package in internal/telemetry

* Update Go version to 1.22 in Dockerfile, go.yml, go.mod, and go.sum

* Update ExtensionManifest version to 2.0.9 on UT

* Add NopLogger documentation to pkg/logging/logging.go

* Added Documentation to Telemetry Pkg

* -Added a Wrapper to HandlerEnviroment to add Additional functionality like the String() func
- Added String() func to handlersettings struct, publicSettings struct, vmWatchSettings struct and
vmWatchSignalFilters struct
- Added Telemetry Event for HandlerSettings, and for HandlerEnviroment

* - Updated HandlerEnviroment String to use MarshallIndent Function.
- Updated HandlerSettings struct String() func to use MarshallIndent
- Fixed Failing UTs due to nil pointer in Embedded Struct inside HandlerEnviroment.

* - Updated vmWatchSetting String Func to use MarshallIdent

* Update ExtensionManifest version to 2.0.10 on Failing UT

* removed duplicated UT

* Removed String() func from VMWatchSignalFilters, publicSettings and protectedSettings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants