Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ if (USE_RDK_LOGGER)
target_link_libraries(${PLUGIN_LEGACY_WIFI} PRIVATE ${RDKLOGGER_LIBRARIES})
endif (USE_RDK_LOGGER)

# Link OpenTelemetry RDK wrapper library
target_link_libraries(${PLUGIN_LEGACY_WIFI} PRIVATE rdk_otlp)

set_target_properties(${PLUGIN_LEGACY_WIFI} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)
Expand Down
13 changes: 13 additions & 0 deletions legacy/LegacyWiFiManagerAPIs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "LegacyWiFiManagerAPIs.h"
#include "NetworkManagerLogger.h"
#include "NetworkManagerJsonEnum.h"
#include "rdk_otlp_instrumentation.h"

using namespace std;
using namespace WPEFramework::Plugin;
Expand Down Expand Up @@ -133,6 +134,9 @@ namespace WPEFramework

m_service->AddRef();

// Initialize OpenTelemetry
rdk_otlp_init("WiFiManager", "1.0.0");

string callsign(NETWORK_MANAGER_CALLSIGN);
string token = "";

Expand Down Expand Up @@ -384,6 +388,12 @@ namespace WPEFramework
uint32_t WiFiManager::getConnectedSSID (const JsonObject& parameters, JsonObject& response)
{
LOG_INPARAM();

// Start distributed trace (creates parent span and stores context)
NMLOG_ERROR("BEFORE OTLP DIST TRACE START");
rdk_otlp_start_distributed_trace("WiFiManager.getConnectedSSID", "get");
NMLOG_ERROR("AFTER OTLP DIST TRACE START");

uint32_t rc = Core::ERROR_GENERAL;
Exchange::INetworkManager::WiFiSSIDInfo ssidInfo{};

Expand All @@ -406,6 +416,9 @@ namespace WPEFramework
response["signalStrength"] = ssidInfo.strength;
response["frequency"] = ssidInfo.frequency;
}
NMLOG_ERROR("BEFORE OTLP DIST TRACE END");
rdk_otlp_finish_distributed_trace();
NMLOG_ERROR("AFTER OTLP DIST TRACE END");
returnJson(rc);
}

Expand Down
4 changes: 4 additions & 0 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ add_library(${MODULE_NAME} SHARED
target_link_libraries(${MODULE_NAME} PRIVATE
${NAMESPACE}Core::${NAMESPACE}Core
${NAMESPACE}Plugins::${NAMESPACE}Plugins
rdk_otlp
)

set_target_properties(${MODULE_NAME} PROPERTIES
Expand Down Expand Up @@ -141,6 +142,9 @@ if (USE_RDK_LOGGER)
target_link_libraries(${MODULE_IMPL_NAME} PRIVATE ${RDKLOGGER_LIBRARIES})
endif (USE_RDK_LOGGER)

# Link OpenTelemetry RDK wrapper library
target_link_libraries(${MODULE_IMPL_NAME} PRIVATE rdk_otlp)

install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)
install(TARGETS ${MODULE_IMPL_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)

Expand Down
3 changes: 3 additions & 0 deletions plugin/NetworkManager.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**

Check failure on line 1 in plugin/NetworkManager.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'plugin/NetworkManager.cpp' (Match: rdkcentral/rdkservices/6.1.7, 140 lines, url: https://github.com/rdkcentral/rdkservices/archive/refs/tags/AML_BSP_REL_VERSION_RDK6.1.7.tar.gz, file: NetworkManager/service/NetworkManager.cpp)
* If not stated otherwise in this file or this component's LICENSE
* file the following copyright and licenses apply:
*
Expand All @@ -18,6 +18,7 @@
**/

#include "NetworkManager.h"
#include "rdk_otlp_instrumentation.h"
#include <random>

namespace WPEFramework
Expand Down Expand Up @@ -67,6 +68,8 @@
// Syslog Startup messages are always printed by default
SYSLOG(Logging::Startup, (_T("Initializing NetworkManager")));
NetworkManagerLogger::Init();
// Initialize OpenTelemetry
rdk_otlp_init("NetworkManager", "1.0.0");
// Register the Connection::Notification first. Do this before we start our actual plugin
// in case something goes wrong or is disconnected - this way we know we're at least registered
// for activate/deactivate events
Expand Down
7 changes: 7 additions & 0 deletions plugin/rdk/NetworkManagerRDKProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "NetworkManagerConnectivity.h"
#include "NetworkManagerRDKProxy.h"
#include "libIBus.h"
#include "rdk_otlp_instrumentation.h"
#include <chrono>

using namespace WPEFramework;
Expand All @@ -33,7 +34,7 @@
{
namespace Plugin
{
NetworkManagerImplementation* _instance = nullptr;

Check failure on line 37 in plugin/rdk/NetworkManagerRDKProxy.cpp

View workflow job for this annotation

GitHub Actions / call-fossid-workflow / Fossid Annotate PR

FossID License Issue Detected

Source code with 'Apache-2.0' license found in local file 'plugin/rdk/NetworkManagerRDKProxy.cpp' (Match: rdkcentral/rdkservices/6.1.7, 1305 lines, url: https://github.com/rdkcentral/rdkservices/archive/refs/tags/AML_BSP_REL_VERSION_RDK6.1.7.tar.gz, file: NetworkManager/service/NetworkManagerRDKProxy.cpp)

Exchange::INetworkManager::WiFiState to_wifi_state(WiFiStatusCode_t code) {
switch (code)
Expand Down Expand Up @@ -1157,6 +1158,9 @@
uint32_t NetworkManagerImplementation::GetConnectedSSID(WiFiSSIDInfo& ssidInfo /* @out */)
{
LOG_ENTRY_FUNCTION();
NMLOG_INFO ("Before OTLP Trace start");
rdk_otlp_start_distributed_trace("ConnectedSSID", "get");
NMLOG_INFO ("After OTLP Trace start");
uint32_t rc = Core::ERROR_RPC_CALL_FAILED;
IARM_Result_t retVal = IARM_RESULT_SUCCESS;
IARM_Bus_WiFiSrvMgr_Param_t param{};
Expand Down Expand Up @@ -1199,6 +1203,9 @@
{
NMLOG_ERROR ("GetConnectedSSID failed");
}
NMLOG_INFO ("Before OTLP Trace end");
rdk_otlp_finish_distributed_trace();
NMLOG_INFO ("Before OTLP Trace end");
return rc;
}

Expand Down
Loading