-
Notifications
You must be signed in to change notification settings - Fork 6
Topic/otel shlib #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Topic/otel shlib #165
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -27,7 +27,7 @@ if ENABLE_RDKC | |||||
| librfcapi_la_CPPFLAGS = "-std=c++11" -DLINUX -fPIC -g -O2 -Wall -DRDKC -I${top_srcdir}/../rdklogger/include/ | ||||||
| librfcapi_la_LIBADD = -L${top_srcdir}/../rdklogger/src/.libs -lrdkloggers | ||||||
| else | ||||||
| librfcapi_la_CPPFLAGS = "-std=c++11" -DLINUX -fPIC -g -O2 -Wall -I=/usr/include/cjson -I=/usr/include/wdmp-c $(IARMBUS_EVENT_FLAG) | ||||||
| librfcapi_la_LIBADD = -lcurl -lcjson -lrdkloggers | ||||||
| librfcapi_la_CPPFLAGS = "-std=c++11" -DLINUX -fPIC -g -O2 -Wall -I=/usr/include/cjson -I=/usr/include/wdmp-c $(IARMBUS_EVENT_FLAG) -I/mnt/L2_CONTAINER_SHARED_VOLUME/dtracing/rdk_otel_instrumentation/include | ||||||
|
||||||
| librfcapi_la_CPPFLAGS = "-std=c++11" -DLINUX -fPIC -g -O2 -Wall -I=/usr/include/cjson -I=/usr/include/wdmp-c $(IARMBUS_EVENT_FLAG) -I/mnt/L2_CONTAINER_SHARED_VOLUME/dtracing/rdk_otel_instrumentation/include | |
| librfcapi_la_CPPFLAGS = "-std=c++11" -DLINUX -fPIC -g -O2 -Wall -I=/usr/include/cjson -I=/usr/include/wdmp-c $(IARMBUS_EVENT_FLAG) $(OTEL_INSTRUMENTATION_CFLAGS) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| /* | ||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||
| * following copyright and licenses apply: | ||||||
|
Check failure on line 3 in rfcapi/rfcapi.cpp
|
||||||
| * | ||||||
| * Copyright 2016 RDK Management | ||||||
| * | ||||||
|
|
@@ -29,6 +29,9 @@ | |||||
| #include <dirent.h> | ||||||
| #include "rfcapi.h" | ||||||
| #include "rdk_debug.h" | ||||||
| #include "rdk_otlp_instrumentation.h" | ||||||
| #include <chrono> | ||||||
| #include <iostream> | ||||||
| using namespace std; | ||||||
|
|
||||||
| #define LOG_RFCAPI "LOG.RDK.RFCAPI" | ||||||
|
|
@@ -266,6 +269,7 @@ | |||||
| CURL *curl_handle = NULL; | ||||||
| CURLcode res = CURLE_FAILED_INIT; | ||||||
|
|
||||||
| //auto startTime = std::chrono::high_resolution_clock::now(); | ||||||
|
||||||
| if(!strcmp(pcParameterName+strlen(pcParameterName)-1,".")) | ||||||
| { | ||||||
| #ifdef TEMP_LOGGING | ||||||
|
|
@@ -449,6 +453,11 @@ | |||||
| cJSON_Delete(response_json); | ||||||
| } | ||||||
| } | ||||||
| //auto endTime = std::chrono::high_resolution_clock::now(); | ||||||
| //auto timeTaken = std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime).count(); | ||||||
| // Record metrics (convert microseconds to seconds) | ||||||
| //double duration_seconds = timeTaken / 1000000.0; | ||||||
| //rdk_otlp_metrics_record_parameter_operation(pcParameterName, "get", duration_seconds); | ||||||
| return ret; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -462,7 +471,7 @@ | |||||
| string response; | ||||||
| CURL *curl_handle = NULL; | ||||||
| CURLcode res = CURLE_FAILED_INIT; | ||||||
|
|
||||||
| //auto startTime = std::chrono::high_resolution_clock::now(); | ||||||
|
||||||
| if(!strcmp(pcParameterName+strlen(pcParameterName)-1,".") && pcParameterValue == NULL) | ||||||
| { | ||||||
| #ifdef TEMP_LOGGING | ||||||
|
|
@@ -564,6 +573,11 @@ | |||||
| cJSON_Delete(response_json); | ||||||
| } | ||||||
| } | ||||||
| //auto endTime = std::chrono::high_resolution_clock::now(); | ||||||
| //auto timeTaken = std::chrono::duration_cast<std::chrono::microseconds>(endTime - startTime).count(); | ||||||
| // Record metrics (convert microseconds to seconds) | ||||||
| //double duration_seconds = timeTaken / 1000000.0; | ||||||
| //rdk_otlp_metrics_record_parameter_operation(pcParameterName, "get", duration_seconds); | ||||||
|
||||||
| //rdk_otlp_metrics_record_parameter_operation(pcParameterName, "get", duration_seconds); | |
| //rdk_otlp_metrics_record_parameter_operation(pcParameterName, "set", duration_seconds); |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -27,8 +27,8 @@ bin_PROGRAMS += rfctool | |||||||
| endif | ||||||||
|
|
||||||||
| tr181_SOURCES = tr181utils.cpp trsetutils.cpp | ||||||||
| tr181_LDADD = ../rfcapi/.libs/librfcapi.la ../tr181api/.libs/libtr181api.la | ||||||||
| tr181_CPPFLAGS = -std=c++0x -Wall -I${top_srcdir}/rfcapi/ -I${top_srcdir}/tr181api/ -I=/usr/include/wdmp-c | ||||||||
| tr181_LDADD = ../rfcapi/.libs/librfcapi.la ../tr181api/.libs/libtr181api.la -lrdk_otlp | ||||||||
| tr181_CPPFLAGS = -std=c++0x -Wall -I${top_srcdir}/rfcapi/ -I${top_srcdir}/tr181api/ -I=/usr/include/wdmp-c -I/mnt/L2_CONTAINER_SHARED_VOLUME/dtracing/rdk_otel_instrumentation/include | ||||||||
|
||||||||
| tr181_CPPFLAGS = -std=c++0x -Wall -I${top_srcdir}/rfcapi/ -I${top_srcdir}/tr181api/ -I=/usr/include/wdmp-c -I/mnt/L2_CONTAINER_SHARED_VOLUME/dtracing/rdk_otel_instrumentation/include | |
| RDK_OTEL_INSTRUMENTATION_CFLAGS ?= -I/mnt/L2_CONTAINER_SHARED_VOLUME/dtracing/rdk_otel_instrumentation/include | |
| tr181_CPPFLAGS = -std=c++0x -Wall -I${top_srcdir}/rfcapi/ -I${top_srcdir}/tr181api/ -I=/usr/include/wdmp-c $(RDK_OTEL_INSTRUMENTATION_CFLAGS) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| /* | ||||||
| * If not stated otherwise in this file or this component's LICENSE file the | ||||||
| * following copyright and licenses apply: | ||||||
|
Check failure on line 3 in utils/tr181utils.cpp
|
||||||
| * | ||||||
| * Copyright 2018 RDK Management | ||||||
| * | ||||||
|
|
@@ -40,7 +40,7 @@ | |||||
| #include "trsetutils.h" | ||||||
| #include <fcntl.h> | ||||||
| #include <unistd.h> | ||||||
|
|
||||||
| #include "rdk_otlp_instrumentation.h" | ||||||
| using namespace std; | ||||||
|
|
||||||
| static char value_type = 'u'; | ||||||
|
|
@@ -138,6 +138,9 @@ | |||||
| */ | ||||||
| static int getAttribute(char * const paramName) | ||||||
| { | ||||||
| // Start distributed trace (creates parent span and stores context) | ||||||
| rdk_otlp_start_distributed_trace(paramName, "get"); | ||||||
|
|
||||||
| if (id && !strncmp(id, "localOnly", 9)) { | ||||||
| TR181_ParamData_t param; | ||||||
| tr181ErrorCode_t status = getLocalParam(id, paramName, ¶m); | ||||||
|
|
@@ -150,6 +153,7 @@ | |||||
| { | ||||||
| cout << __FUNCTION__ << " >> Failed to retrieve : Reason " << getTR181ErrorString(status) << endl; | ||||||
| } | ||||||
| rdk_otlp_finish_distributed_trace(); | ||||||
| return status; | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -165,7 +169,8 @@ | |||||
| { | ||||||
| cout << __FUNCTION__ << " >> Failed to retrieve : Reason " << getRFCErrorString(status) << endl; | ||||||
| } | ||||||
|
|
||||||
| // Finish distributed trace (ends parent span) | ||||||
| rdk_otlp_finish_distributed_trace(); | ||||||
| return status; | ||||||
| } | ||||||
| /** | ||||||
|
|
@@ -177,6 +182,8 @@ | |||||
| */ | ||||||
| static int setAttribute(char * const paramName ,char type, char * value) | ||||||
| { | ||||||
| //Start distributed trace (creates parent span and stores context) | ||||||
|
||||||
| //Start distributed trace (creates parent span and stores context) | |
| // Start distributed trace (creates parent span and stores context) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rfcMgr includes the "rdk_otlp_instrumentation.h" header file at line 22 and calls rdk_otlp_init and rdk_otlp_metrics_init, but the Makefile doesn't include the path to find this header. The include path should be added to rfcMgr_CPPFLAGS, similar to what was done in rfcapi/Makefile.am and utils/Makefile.am. Without this, the build will fail with a "header not found" error.