RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin#323
Open
gururaajar wants to merge 2 commits into
Open
RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin#323gururaajar wants to merge 2 commits into
gururaajar wants to merge 2 commits into
Conversation
* RDK-55826: Implement T2 Eventing in Network Manager Plugin Reason for Change: Added T2 marker for the identified T1 telemetry markers Test Procedure: Check whether the T2 events are received in the elk. Priority: P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com> * RDK-55826: Implement T2 Eventing in Network Manager Plugin Reason for Change: Added T2 marker for the identified T1 telemetry markers Test Procedure: Check whether the T2 events are received in the elk. Priority: P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com> --------- Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
* RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin Reason for Change: Added T2 marker for the identified T1 telemetry markers Test Procedure: Check whether the T2 events are received in the elk. Priority: P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com> * RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin Reason for Change: Added T2 marker for the identified T1 telemetry markers Test Procedure: Check whether the T2 events are received in the elk. Priority: P1 Risks: Medium Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com> --------- Signed-off-by: Gururaaja ESR<Gururaja_ErodeSriranganRamlingham@comcast.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds T2 telemetry eventing to the NetworkManager plugin and related tooling/tests, aiming to emit T2 markers for existing telemetry points (e.g., public IP, interface/internet/WiFi status, gateway MAC).
Changes:
- Introduces
USE_TELEMETRYCMake option and wires T2 (include dirs/libs + compile define) across the build. - Adds T2 event emission in
NetworkManagerImplementationand gateway-MAC telemetry in GNOME event handling. - Updates L2 tests/mocks to wrap new libnm and curl symbols used by the updated code paths.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Adds USE_TELEMETRY option, finds T2, and sets compile definition. |
| plugin/CMakeLists.txt | Adds T2 include paths and links T2 libs for plugin targets when enabled. |
| plugin/NetworkManagerImplementation.h | Declares logTelemetry() helper for T2 emission. |
| plugin/NetworkManagerImplementation.cpp | Initializes T2 and emits new T2 events (public IP, interface/internet/WiFi status). |
| plugin/gnome/NetworkManagerGnomeEvents.cpp | Emits gateway MAC telemetry on WiFi/Ethernet activation and minor brace cleanup. |
| plugin/gnome/NetworkManagerGnomeUtils.h | Adds gateway MAC resolution helpers to the utils API. |
| plugin/gnome/NetworkManagerGnomeUtils.cpp | Implements gateway IP→MAC resolution via /proc/net/arp and NM IPv4 config. |
| plugin/gnome/NetworkManagerGnomeWIFI.cpp | Removes a stray blank line. |
| tools/upnp/CMakeLists.txt | Switches telemetry include usage to T2_INCLUDE_DIRS and relies on top-level T2 discovery. |
| tools/plugincli/CMakeLists.txt | Links GDBUS CLI tool against libnm libraries. |
| tests/mocks/LibnmWrapsMock.h | Adds nm_device_get_ip4_config real symbol declaration for wrapping. |
| tests/mocks/LibnmWraps.h | Adds wrapper interface + static entry for nm_device_get_ip4_config. |
| tests/mocks/LibnmWraps.cpp | Adds __wrap_nm_device_get_ip4_config and forwards through mock impl. |
| tests/l2Test/libnm/CMakeLists.txt | Wraps curl_multi_* and nm_device_get_ip4_config; links curl/libnm in L2 test. |
| tests/l2Test/libnm/l2_test_libnmproxyEvent.cpp | Adds Curl wraps mock setup/teardown; improves NMDevice lifecycle in tests; adds eth0 activated test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1297
to
+1306
| void NetworkManagerImplementation::logTelemetry(const std::string& eventName, const std::string& message) | ||
| { | ||
| #if USE_TELEMETRY | ||
| T2ERROR t2error = t2_event_s(eventName.c_str(), const_cast<char*>(message.c_str())); | ||
| if (t2error != T2ERROR_SUCCESS) { | ||
| NMLOG_ERROR("t2_event_s(\"%s\", \"%s\") failed with error %d", | ||
| eventName.c_str(), message.c_str(), t2error); | ||
| } | ||
| #endif | ||
| } |
Comment on lines
736
to
744
| for (const auto callback : _notificationCallbacks) { | ||
| callback->onActiveInterfaceChange(prevActiveInterface, currentActiveinterface); | ||
| } | ||
| #if USE_TELEMETRY | ||
| NMLOG_INFO("NM_INTERFACE_STATUS = Interface changed to %s", currentActiveinterface.c_str()); | ||
| logTelemetry("NM_INTERFACE_STATUS", "Interface changed to " + currentActiveinterface); | ||
| #endif | ||
| _notificationLock.Unlock(); | ||
| } |
Comment on lines
786
to
809
| { | ||
| _notificationLock.Lock(); | ||
| NMLOG_INFO("Posting onInternetStatusChange with current state as %u", (unsigned)currState); | ||
| #if USE_TELEMETRY | ||
| // Log error only when ethernet is up and there's no internet | ||
| if(currState == Exchange::INetworkManager::INTERNET_NOT_AVAILABLE && | ||
| m_ethConnected.load() && | ||
| interface == "eth0" && | ||
| prevState != Exchange::INetworkManager::INTERNET_NOT_AVAILABLE) | ||
| { | ||
| NMLOG_INFO("NM_ETHERNET_CONNECTIVITY = Ethernet connectivity failed"); | ||
| logTelemetry("NM_ETHERNET_CONNECTIVITY", "Ethernet connectivity failed"); | ||
| } | ||
| #endif | ||
| for (const auto callback : _notificationCallbacks) { | ||
| callback->onInternetStatusChange(prevState, currState, interface); | ||
| } | ||
| #if USE_TELEMETRY | ||
| string stateStr = Core::EnumerateType<Exchange::INetworkManager::InternetStatus>(currState).Data(); | ||
| NMLOG_INFO("NM_INTERNET_STATUS = %s", stateStr.c_str()); | ||
| logTelemetry("NM_INTERNET_STATUS", stateStr); | ||
| #endif | ||
| _notificationLock.Unlock(); | ||
| } |
Comment on lines
+1156
to
+1160
| #if USE_TELEMETRY | ||
| string stateStr = Core::EnumerateType<Exchange::INetworkManager::WiFiState>(state).Data(); | ||
| NMLOG_INFO("NM_WIFI_STATUS = %s", stateStr.c_str()); | ||
| logTelemetry("NM_WIFI_STATUS", stateStr); | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RDKEMW-14959: Implement T2 Eventing in Network Manager Plugin (#282)
RDK-55826: Implement T2 Eventing in Network Manager Plugin
Reason for Change: Added T2 marker for the identified T1 telemetry markers
Test Procedure: Check whether the T2 events are received in the elk.
Priority: P1
Risks: Medium
Signed-off-by: Gururaaja ESRGururaja_ErodeSriranganRamlingham@comcast.com