Skip to content

Commit

Permalink
Merge pull request #173 from mathworks/autotrace
Browse files Browse the repository at this point in the history
Update to otel-cpp 1.17.0
  • Loading branch information
duncanpo authored Nov 14, 2024
2 parents 758c09f + ec2be1b commit 6faf264
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ if(NOT DEFINED OTEL_CPP_INSTALLED_DIR)
include(ExternalProject)
set(OTEL_CPP_PROJECT_NAME opentelemetry-cpp)
set(OTEL_CPP_GIT_REPOSITORY "https://github.com/open-telemetry/opentelemetry-cpp.git")
set(OTEL_CPP_GIT_TAG "baecbb9")
set(OTEL_CPP_GIT_TAG "fa0a520")

set(OTEL_CPP_CXX_STANDARD 14)

Expand All @@ -209,15 +209,14 @@ if(NOT DEFINED OTEL_CPP_INSTALLED_DIR)
set(patch_command "")
endif()

# 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
ExternalProject_Add(
${OTEL_CPP_PROJECT_NAME}
GIT_REPOSITORY ${OTEL_CPP_GIT_REPOSITORY}
GIT_TAG ${OTEL_CPP_GIT_TAG}
PREFIX ${OTEL_CPP_PREFIX}
UPDATE_DISCONNECTED 1
PATCH_COMMAND ${patch_command}
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}
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}
BUILD_BYPRODUCTS ${OTEL_CPP_LIBRARIES}
INSTALL_DIR ${OTEL_CPP_PREFIX}
INSTALL_COMMAND ${CMAKE_COMMAND} --install . --prefix ${OTEL_CPP_PREFIX} --config $<CONFIG>
Expand Down
1 change: 1 addition & 0 deletions sdk/common/src/resource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "opentelemetry-matlab/common/attribute.h"

#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/common/key_value_iterable_view.h"
#include "opentelemetry/nostd/string_view.h"

namespace common = opentelemetry::common;
Expand Down
3 changes: 2 additions & 1 deletion test/tlogs_sdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ function testOtlpFileExporter(testCase)
% perform test comparisons
forceFlush(lp, testCase.ForceFlushTimeout);
clear("lg", "lp");
results = jsondecode(fileread(alias));
resultstxt = readlines(alias);
results = jsondecode(resultstxt(1));

% check logger name, log body and severity
verifyEqual(testCase, string(results.resourceLogs.scopeLogs.scope.name), loggername);
Expand Down
3 changes: 2 additions & 1 deletion test/tmetrics_sdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ function testOtlpFileExporter(testCase)
% fetch result
forceFlush(p);
clear("ct", "mt", "p");
results = jsondecode(fileread(alias));
resultstxt = readlines(alias);
results = jsondecode(resultstxt(1));

% verify meter and counter names
verifyEqual(testCase, string(results.resourceMetrics.scopeMetrics.metrics.name), countername);
Expand Down
3 changes: 2 additions & 1 deletion test/ttrace_sdk.m
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ function testOtlpFileExporter(testCase)
clear("sp", "tr", "tp");

% perform test comparisons
results = jsondecode(fileread(alias));
resultstxt = readlines(alias);
results = jsondecode(resultstxt(1));

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

0 comments on commit 6faf264

Please sign in to comment.