Skip to content

Commit 6faf264

Browse files
authored
Merge pull request #173 from mathworks/autotrace
Update to otel-cpp 1.17.0
2 parents 758c09f + ec2be1b commit 6faf264

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

CMakeLists.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ if(NOT DEFINED OTEL_CPP_INSTALLED_DIR)
191191
include(ExternalProject)
192192
set(OTEL_CPP_PROJECT_NAME opentelemetry-cpp)
193193
set(OTEL_CPP_GIT_REPOSITORY "https://github.com/open-telemetry/opentelemetry-cpp.git")
194-
set(OTEL_CPP_GIT_TAG "baecbb9")
194+
set(OTEL_CPP_GIT_TAG "fa0a520")
195195

196196
set(OTEL_CPP_CXX_STANDARD 14)
197197

@@ -209,15 +209,14 @@ if(NOT DEFINED OTEL_CPP_INSTALLED_DIR)
209209
set(patch_command "")
210210
endif()
211211

212-
# WITH_DEPRECATED_SDK_FACTORY flag is only needed for versions 1.16.0 and 1.16.1, and will be removed in 1.17.0
213212
ExternalProject_Add(
214213
${OTEL_CPP_PROJECT_NAME}
215214
GIT_REPOSITORY ${OTEL_CPP_GIT_REPOSITORY}
216215
GIT_TAG ${OTEL_CPP_GIT_TAG}
217216
PREFIX ${OTEL_CPP_PREFIX}
218217
UPDATE_DISCONNECTED 1
219218
PATCH_COMMAND ${patch_command}
220-
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DWITH_OTLP_HTTP=${WITH_OTLP_HTTP} -DWITH_OTLP_GRPC=${WITH_OTLP_GRPC} -DWITH_OTLP_FILE=${WITH_OTLP_FILE} -DBUILD_TESTING=OFF -DWITH_BENCHMARK=OFF -DWITH_DEPRECATED_SDK_FACTORY=OFF -DOPENTELEMETRY_INSTALL=ON -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_CXX_STANDARD=${OTEL_CPP_CXX_STANDARD} -DVCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR} ${TRIPLET_DEFINITIONS}
219+
CMAKE_ARGS -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DWITH_OTLP_HTTP=${WITH_OTLP_HTTP} -DWITH_OTLP_GRPC=${WITH_OTLP_GRPC} -DWITH_OTLP_FILE=${WITH_OTLP_FILE} -DBUILD_TESTING=OFF -DWITH_BENCHMARK=OFF -DOPENTELEMETRY_INSTALL=ON -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_CXX_STANDARD=${OTEL_CPP_CXX_STANDARD} -DVCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR} ${TRIPLET_DEFINITIONS}
221220
BUILD_BYPRODUCTS ${OTEL_CPP_LIBRARIES}
222221
INSTALL_DIR ${OTEL_CPP_PREFIX}
223222
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --prefix ${OTEL_CPP_PREFIX} --config $<CONFIG>

sdk/common/src/resource.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "opentelemetry-matlab/common/attribute.h"
77

88
#include "opentelemetry/common/attribute_value.h"
9+
#include "opentelemetry/common/key_value_iterable_view.h"
910
#include "opentelemetry/nostd/string_view.h"
1011

1112
namespace common = opentelemetry::common;

test/tlogs_sdk.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ function testOtlpFileExporter(testCase)
6868
% perform test comparisons
6969
forceFlush(lp, testCase.ForceFlushTimeout);
7070
clear("lg", "lp");
71-
results = jsondecode(fileread(alias));
71+
resultstxt = readlines(alias);
72+
results = jsondecode(resultstxt(1));
7273

7374
% check logger name, log body and severity
7475
verifyEqual(testCase, string(results.resourceLogs.scopeLogs.scope.name), loggername);

test/tmetrics_sdk.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ function testOtlpFileExporter(testCase)
9797
% fetch result
9898
forceFlush(p);
9999
clear("ct", "mt", "p");
100-
results = jsondecode(fileread(alias));
100+
resultstxt = readlines(alias);
101+
results = jsondecode(resultstxt(1));
101102

102103
% verify meter and counter names
103104
verifyEqual(testCase, string(results.resourceMetrics.scopeMetrics.metrics.name), countername);

test/ttrace_sdk.m

+2-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ function testOtlpFileExporter(testCase)
189189
clear("sp", "tr", "tp");
190190

191191
% perform test comparisons
192-
results = jsondecode(fileread(alias));
192+
resultstxt = readlines(alias);
193+
results = jsondecode(resultstxt(1));
193194

194195
% check span and tracer names
195196
verifyEqual(testCase, string(results.resourceSpans.scopeSpans.spans.name), spanname);

0 commit comments

Comments
 (0)