You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/context_propagation/README.md
+33-7Lines changed: 33 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,12 +9,38 @@ In this example, a C++ client calls a MATLAB function hosted on MATLAB Productio
9
9
cmake --build build --config Release
10
10
```
11
11
The built examples can be found in build/examples/context_propagation and subdirectories.
12
-
2.[Create](https://www.mathworks.com/help/mps/server/creating-a-server.html) and [start](https://www.mathworks.com/help/mps/qs/starting-and-stopping.html) a MATLAB Production Server instance.
13
-
3.[Deploy](https://www.mathworks.com/help/mps/qs/share-a-ctf-archive-on-the-server-instance.html) archive to server instance by copying to the auto_deploy directory.
14
-
4. If using a MATLAB release before R2023b, [copy](https://www.mathworks.com/help/mps/server/use-web-handler-for-custom-routes-and-custom-payloads.html) matlab/routes.json to the config directory of the server instance.
15
-
6. Start an instance of [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector).
16
-
7. Start the C++ client.
12
+
## Testing the Example
13
+
1. Start an instance of [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector).
14
+
2. Test the generated .ctf archive using the [testing interface](https://www.mathworks.com/help/compiler_sdk/mps_dev_test/test-web-request-handler.html) in the Production Server Compiler app.
15
+
1. In MATLAB, cd to the example directory.
16
+
```
17
+
cd examples/context_propagation/matlab
18
+
```
19
+
2. Set environment variable PRODSERVER_ROUTES_FILE to point to the routes file.
20
+
```
21
+
setenv("PRODSERVER_ROUTES_FILE", "routes.json")
22
+
```
23
+
3. Start Production Server Compiler app.
24
+
```
25
+
productionServerCompiler
26
+
```
27
+
4. In the app, select Type as "Deployable Archive (.ctf)", and add mymagic.m as an exported function.
28
+
5. Specify "mymagic" as the archive name.
29
+
6. Click on the "Test Client" button.
30
+
7. Ensure the port is 9910, then start the test.
31
+
8. Start the C++ client from a command prompt.
32
+
```
33
+
cd build/examples/context_propagation/Release
34
+
contextprop_example_client
35
+
```
36
+
9. Check for expected spans in the OpenTelemetry Collector or in a specified tracing backend.
37
+
## Deploying the Example
38
+
1. If testing works, proceed to deploy the example. [Create](https://www.mathworks.com/help/mps/server/creating-a-server.html) and [start](https://www.mathworks.com/help/mps/qs/starting-and-stopping.html) a MATLAB Production Server instance.
39
+
2. [Deploy](https://www.mathworks.com/help/mps/qs/share-a-ctf-archive-on-the-server-instance.html) archive mymagic.ctf to server instance by copying to the auto_deploy directory.
40
+
3. If using a MATLAB release before R2023b, [copy](https://www.mathworks.com/help/mps/server/use-web-handler-for-custom-routes-and-custom-payloads.html) matlab/routes.json to the config directory of the server instance.
41
+
4. Start the C++ client from a command prompt.
17
42
```
18
-
cd cpp/build/Release
19
-
http_client
43
+
cd build/examples/context_propagation/Release
44
+
contextprop_example_client
20
45
```
46
+
5. Check for expected spans in the OpenTelemetry Collector or in a specified tracing backend.
0 commit comments