Azure / WALinuxAgent

Microsoft Azure Linux Guest Agent
http://azure.microsoft.com/
Apache License 2.0
543 stars 372 forks source link

Update logcollector telemetry with common properties #3242

Closed maddieford closed 1 month ago

maddieford commented 1 month ago

Description

The log collector process first checks that cgroups are setup correctly, adding any telemetry events if there are unexpected results.

Previously, the common properties for the telemetry events were initialized in LogCollector init, but LogCollector was not initialized until after cgroup checks. As a result, if the process added any events during cgroup checks, the common properties were not initialized: Message ContainerId RoleInstanceName TenantName
Unable to determine which cgroup version to use: [CGroupsException] Detected hybrid cgroup mode, but there are controllers available to be enabled in unified hierarchy: cpuset 00000000-0000-0000-0000-000000000000 RoleInstanceName_UNINITIALIZED TenantName_UNINITIALIZED

This PR updates the log collector process to initialize the common properties in telemetry events before any cgroup checks. It also adds a telemetry event for uncompressed file size before we expect the process to exit due to mem limit exceeded.

Issue #


PR information

Quality of Code and Contribution Guidelines

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.54%. Comparing base (3aebcdd) to head (68ba023). Report is 320 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #3242 +/- ## =========================================== + Coverage 71.97% 72.54% +0.56% =========================================== Files 103 114 +11 Lines 15692 16900 +1208 Branches 2486 2247 -239 =========================================== + Hits 11295 12260 +965 - Misses 3881 4105 +224 - Partials 516 535 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.