From 21ddf0c0b4682545292818d5f568f38dd733fa23 Mon Sep 17 00:00:00 2001 From: Sam Eagen Date: Wed, 11 Mar 2026 15:38:37 -0400 Subject: [PATCH 1/2] Only ship mbt plugin if gRPC is installed --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c3abb20..354b36a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -627,13 +627,13 @@ install(DIRECTORY ${METRICS_SDK_MATLAB_SOURCES} DESTINATION .) install(DIRECTORY ${LOGS_SDK_MATLAB_SOURCES} DESTINATION .) install(DIRECTORY ${COMMON_SDK_MATLAB_SOURCES} DESTINATION .) install(DIRECTORY ${AUTO_INSTRUMENTATION_MATLAB_SOURCES} DESTINATION .) -install(DIRECTORY ${INSTRUMENTATION_MBT_MATLAB_SOURCES} DESTINATION .) install(FILES ${EXPORTER_MATLAB_SOURCES} DESTINATION ${OTLP_EXPORTERS_DIR}) if(WITH_OTLP_HTTP) install(FILES ${OTLP_HTTP_EXPORTER_MATLAB_SOURCES} DESTINATION ${OTLP_EXPORTERS_DIR}) endif() if(WITH_OTLP_GRPC) install(FILES ${OTLP_GRPC_EXPORTER_MATLAB_SOURCES} DESTINATION ${OTLP_EXPORTERS_DIR}) + install(DIRECTORY ${INSTRUMENTATION_MBT_MATLAB_SOURCES} DESTINATION .) endif() if(WITH_OTLP_FILE) install(FILES ${OTLP_FILE_EXPORTER_MATLAB_SOURCES} DESTINATION ${OTLP_EXPORTERS_DIR}) From ff6ca73f746013ffb4944a66de15923b3524bac3 Mon Sep 17 00:00:00 2001 From: Sam Eagen Date: Thu, 12 Mar 2026 10:18:40 -0400 Subject: [PATCH 2/2] Update test method setup to avoid creating build plugin until it's determined that we're in the version of the support package with gRPC --- test/tbuildtoolplugin.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/tbuildtoolplugin.m b/test/tbuildtoolplugin.m index 8f538fc..b0c6ae3 100644 --- a/test/tbuildtoolplugin.m +++ b/test/tbuildtoolplugin.m @@ -29,11 +29,11 @@ function setup(testCase) end function onlyTestIfgRPCIsInstalled(testCase) + % Do not run if gRPC is not installed testCase.assumeTrue(logical(exist("opentelemetry.exporters.otlp.OtlpGrpcSpanExporter", "class")), ... "Otlp gRPC exporter must be installed."); - end - - function createBuildRunner(testCase) + + % Set up build runner plugin = matlab.buildtool.plugins.OpenTelemetryPlugin(); testCase.BuildRunner = matlab.buildtool.BuildRunner.withNoPlugins(); testCase.BuildRunner.addPlugin(plugin); @@ -474,4 +474,4 @@ function buildToolDoesNotConfigureOTelWhenEnvVariableSet(testCase) end error("No span found"); -end \ No newline at end of file +end