From c75dd55baa536b45b9dcf1313b47684a84e51dcf Mon Sep 17 00:00:00 2001 From: duncanpo Date: Thu, 5 Sep 2024 12:23:30 -0400 Subject: [PATCH 1/2] Fix a test failure by force flushing, fixes #156 --- test/tmetrics_sdk.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/tmetrics_sdk.m b/test/tmetrics_sdk.m index a4f7091..2ee2533 100644 --- a/test/tmetrics_sdk.m +++ b/test/tmetrics_sdk.m @@ -95,6 +95,7 @@ function testOtlpFileExporter(testCase) ct.add(val); % fetch result + forceFlush(p); clear("ct", "mt", "p"); results = jsondecode(fileread(alias)); @@ -539,4 +540,4 @@ function testCleanupApi(testCase) verifyEmpty(testCase, results); end end -end \ No newline at end of file +end From a3436839b38a5b4202b5c5c30bf65011b6aef786 Mon Sep 17 00:00:00 2001 From: duncanpo Date: Thu, 5 Sep 2024 12:48:10 -0400 Subject: [PATCH 2/2] Add a note in context_propagation example readme about possible timeout in the first call, closes #23 --- examples/context_propagation/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/context_propagation/README.md b/examples/context_propagation/README.md index 9966bcd..9bd5ad2 100644 --- a/examples/context_propagation/README.md +++ b/examples/context_propagation/README.md @@ -44,3 +44,5 @@ In this example, a C++ client calls a MATLAB function hosted on MATLAB Productio contextprop_example_client ``` 5. Check for expected spans in the OpenTelemetry Collector or in a specified tracing backend. + +**NOTE:** In the first call to MATLAB Production Server, it needs to perform a significant amount of loading and initialization, and as a result the client may time out and return an error status. This should only happen in the first call and not in subsequent calls.