Skip to content

Commit a12ad18

Browse files
authored
Merge pull request #153 from mathworks/testing
Adding codecov configuration
2 parents 52c6af2 + d4be55b commit a12ad18

File tree

3 files changed

+170
-117
lines changed

3 files changed

+170
-117
lines changed

.github/workflows/build_and_test_full.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Build OpenTelemetry-Matlab
4747
working-directory: opentelemetry-matlab
4848
run: |
49-
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DUSE_BATCH_FOR_MCC=ON -DOTEL_MATLAB_VERSION=${{ needs.get_version.outputs.version }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
49+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DUSE_BATCH_FOR_MCC=ON -DOTEL_MATLAB_VERSION=${{ needs.get_version.outputs.version }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
5050
cmake --build build --config Release --target install
5151
- name: Run tests
5252
env:
@@ -56,6 +56,45 @@ jobs:
5656
uses: matlab-actions/run-tests@v2
5757
with:
5858
select-by-folder: opentelemetry-matlab/test
59+
code-coverage-build-and-run-tests-ubuntu:
60+
# Running on ubuntu-latest would use a glibc version that is incompatible when using the built mex files on a Debian 11
61+
# Instead, run on ubuntu-20.04
62+
runs-on: ubuntu-20.04
63+
needs: get_version
64+
env:
65+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
66+
SYSTEM_LIBSTDCPP_PATH: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
67+
steps:
68+
- name: Download OpenTelemetry-Matlab source
69+
uses: actions/checkout@v3
70+
with:
71+
path: opentelemetry-matlab
72+
- name: Install ninja-build
73+
run: sudo apt-get install ninja-build
74+
- name: Install MATLAB
75+
uses: matlab-actions/setup-matlab@v2
76+
with:
77+
products: MATLAB_Compiler MATLAB_Compiler_SDK
78+
- name: Build OpenTelemetry-Matlab
79+
working-directory: opentelemetry-matlab
80+
run: |
81+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DUSE_BATCH_FOR_MCC=ON -DOTEL_MATLAB_VERSION=${{ needs.get_version.outputs.version }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
82+
cmake --build build --config Release --target install
83+
- name: Run tests & get coverage
84+
env:
85+
# Add the installation directory to the MATLAB Search Path by
86+
# setting the MATLABPATH environment variable.
87+
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
88+
uses: matlab-actions/run-tests@v2
89+
with:
90+
source-folder: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
91+
code-coverage-cobertura: cobertura.xml
92+
- name: Upload Codecov
93+
uses: codecov/codecov-action@v4
94+
with:
95+
token: ${{ secrets.CODECOV_TOKEN }}
96+
slug: mathworks/OpenTelemetry-Matlab
97+
file: cobertura.xml
5998
build-and-run-tests-windows:
6099
runs-on: windows-latest
61100
needs: get_version

README.md

Lines changed: 116 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,116 +1,116 @@
1-
# MATLAB Interface to OpenTelemetry
2-
[![View OpenTelemetry-Matlab on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/130979-opentelemetry-matlab) [![MATLAB](https://github.com/mathworks/OpenTelemetry-Matlab/actions/workflows/build_and_test_full.yml/badge.svg)](https://github.com/mathworks/OpenTelemetry-Matlab/actions/workflows/build_and_test_full.yml)
3-
4-
MATLAB® interface to [OpenTelemetry™](https://opentelemetry.io/), based on the [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel/). OpenTelemetry is an observability framework for creating and managing telemetry data, such as traces, metrics, and logs. This data can then be sent to an observability back-end for monitoring, alerts, and analysis.
5-
6-
### Status
7-
- Tracing, metrics, and logs are all fully supported.
8-
- Supported and tested on Windows®, Linux®, and macOS.
9-
10-
### MathWorks Products (https://www.mathworks.com)
11-
12-
Requires MATLAB release R2022b or newer
13-
- [MATLAB](https://www.mathworks.com/products/matlab.html)
14-
15-
### 3rd Party Products:
16-
- [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-releases/releases)
17-
- [OpenTelemetry C++](https://github.com/open-telemetry/opentelemetry-cpp)
18-
- [vcpkg C/C++ dependency manager](https://vcpkg.io)
19-
20-
## Installation
21-
Installation instructions
22-
23-
### Installing With Toolbox Package
24-
1. Under "Assets" of a release, download the toolbox package .mltbx file.
25-
2. Start MATLAB.
26-
3. In the Current Folder browser, navigate to the .mltbx file.
27-
4. Right click on the .mltbx file and select "Install".
28-
29-
### Building From Source
30-
Before proceeding, ensure that the below products are installed:
31-
* [MATLAB](https://www.mathworks.com/products/matlab.html)
32-
33-
1. Download, Build and install OpenTelemetry MATLAB
34-
```
35-
cd <opentelemetry-matlab-root>
36-
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<opentelemetry-matlab-installdir>
37-
cmake --build build --config Release --target install
38-
39-
```
40-
2. Download [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-releases/releases). You can just obtain a pre-built binary for your platform.
41-
42-
## Getting Started
43-
1. Start OpenTelemetry Collector
44-
```
45-
otelcol --config <otelcol-config-yaml>
46-
```
47-
2. Start MATLAB
48-
3. Add the OpenTelemetry MATLAB install directories to your MATLAB path
49-
```
50-
>> addpath <OpenTelemetry MATLAB installdir>
51-
```
52-
## Examples
53-
### Tracing
54-
1. Create a default tracer provider and save it.
55-
```
56-
>> p = opentelemetry.sdk.trace.TracerProvider();
57-
>> setTracerProvider(p);
58-
```
59-
2. Start a span
60-
```
61-
>> tr = opentelemetry.trace.getTracer("My Tracer");
62-
>> sp = tr.startSpan("My Span");
63-
```
64-
3. End the span
65-
```
66-
>> sp.endSpan();
67-
```
68-
4. If your collector is configured to display the data, you should see your span displayed.
69-
### Metrics
70-
1. Create a default meter provider and save it.
71-
```
72-
>> p = opentelemetry.sdk.metrics.MeterProvider();
73-
>> setMeterProvider(p);
74-
```
75-
2. Create a counter
76-
```
77-
>> m = opentelemetry.metrics.getMeter("My Meter");
78-
>> c = m.createCounter("My Counter");
79-
```
80-
3. Increment the counter
81-
```
82-
>> c.add(10);
83-
```
84-
4. If your collector is configured to display the data, you should see your counter displayed after 1 minute.
85-
86-
### Logs
87-
1. Create a default logger provider and save it.
88-
```
89-
>> p = opentelemetry.sdk.logs.LoggerProvider();
90-
>> setLoggerProvider(p);
91-
```
92-
2. Create a logger
93-
```
94-
>> l = opentelemetry.logs.getLogger("My Logger");
95-
```
96-
3. Emit a log record with "info" level
97-
```
98-
>> info(l, "My Message");
99-
```
100-
4. If your collector is configured to display the data, you should see your log record displayed.
101-
102-
For more examples, see the "examples" folder.
103-
104-
## Help
105-
To view documentation of individual function, type "help \<function_name>\". For example,
106-
```
107-
>> help opentelemetry.sdk.trace.TracerProvider
108-
```
109-
110-
## License
111-
The license is available in the License file within this repository
112-
113-
## Community Support
114-
[MATLAB Central](https://www.mathworks.com/matlabcentral)
115-
116-
Copyright 2023-2024 The MathWorks, Inc.
1+
# MATLAB Interface to OpenTelemetry
2+
[![View OpenTelemetry-Matlab on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/130979-opentelemetry-matlab) [![MATLAB](https://github.com/mathworks/OpenTelemetry-Matlab/actions/workflows/build_and_test_full.yml/badge.svg)](https://github.com/mathworks/OpenTelemetry-Matlab/actions/workflows/build_and_test_full.yml)[![codecov](https://codecov.io/github/mathworks/OpenTelemetry-MATLAB/graph/badge.svg?token=VNj6f1LlMG)](https://codecov.io/github/mathworks/OpenTelemetry-MATLAB)
3+
4+
MATLAB&reg; interface to [OpenTelemetry&trade;](https://opentelemetry.io/), based on the [OpenTelemetry Specification](https://opentelemetry.io/docs/specs/otel/). OpenTelemetry is an observability framework for creating and managing telemetry data, such as traces, metrics, and logs. This data can then be sent to an observability back-end for monitoring, alerts, and analysis.
5+
6+
### Status
7+
- Tracing, metrics, and logs are all fully supported.
8+
- Supported and tested on Windows&reg;, Linux&reg;, and macOS.
9+
10+
### MathWorks Products (https://www.mathworks.com)
11+
12+
Requires MATLAB release R2022b or newer
13+
- [MATLAB](https://www.mathworks.com/products/matlab.html)
14+
15+
### 3rd Party Products:
16+
- [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-releases/releases)
17+
- [OpenTelemetry C++](https://github.com/open-telemetry/opentelemetry-cpp)
18+
- [vcpkg C/C++ dependency manager](https://vcpkg.io)
19+
20+
## Installation
21+
Installation instructions
22+
23+
### Installing With Toolbox Package
24+
1. Under "Assets" of a release, download the toolbox package .mltbx file.
25+
2. Start MATLAB.
26+
3. In the Current Folder browser, navigate to the .mltbx file.
27+
4. Right click on the .mltbx file and select "Install".
28+
29+
### Building From Source
30+
Before proceeding, ensure that the below products are installed:
31+
* [MATLAB](https://www.mathworks.com/products/matlab.html)
32+
33+
1. Download, Build and install OpenTelemetry MATLAB
34+
```
35+
cd <opentelemetry-matlab-root>
36+
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<opentelemetry-matlab-installdir>
37+
cmake --build build --config Release --target install
38+
39+
```
40+
2. Download [OpenTelemetry Collector](https://github.com/open-telemetry/opentelemetry-collector-releases/releases). You can just obtain a pre-built binary for your platform.
41+
42+
## Getting Started
43+
1. Start OpenTelemetry Collector
44+
```
45+
otelcol --config <otelcol-config-yaml>
46+
```
47+
2. Start MATLAB
48+
3. Add the OpenTelemetry MATLAB install directories to your MATLAB path
49+
```
50+
>> addpath <OpenTelemetry MATLAB installdir>
51+
```
52+
## Examples
53+
### Tracing
54+
1. Create a default tracer provider and save it.
55+
```
56+
>> p = opentelemetry.sdk.trace.TracerProvider();
57+
>> setTracerProvider(p);
58+
```
59+
2. Start a span
60+
```
61+
>> tr = opentelemetry.trace.getTracer("My Tracer");
62+
>> sp = tr.startSpan("My Span");
63+
```
64+
3. End the span
65+
```
66+
>> sp.endSpan();
67+
```
68+
4. If your collector is configured to display the data, you should see your span displayed.
69+
### Metrics
70+
1. Create a default meter provider and save it.
71+
```
72+
>> p = opentelemetry.sdk.metrics.MeterProvider();
73+
>> setMeterProvider(p);
74+
```
75+
2. Create a counter
76+
```
77+
>> m = opentelemetry.metrics.getMeter("My Meter");
78+
>> c = m.createCounter("My Counter");
79+
```
80+
3. Increment the counter
81+
```
82+
>> c.add(10);
83+
```
84+
4. If your collector is configured to display the data, you should see your counter displayed after 1 minute.
85+
86+
### Logs
87+
1. Create a default logger provider and save it.
88+
```
89+
>> p = opentelemetry.sdk.logs.LoggerProvider();
90+
>> setLoggerProvider(p);
91+
```
92+
2. Create a logger
93+
```
94+
>> l = opentelemetry.logs.getLogger("My Logger");
95+
```
96+
3. Emit a log record with "info" level
97+
```
98+
>> info(l, "My Message");
99+
```
100+
4. If your collector is configured to display the data, you should see your log record displayed.
101+
102+
For more examples, see the "examples" folder.
103+
104+
## Help
105+
To view documentation of individual function, type "help \<function_name>\". For example,
106+
```
107+
>> help opentelemetry.sdk.trace.TracerProvider
108+
```
109+
110+
## License
111+
The license is available in the License file within this repository
112+
113+
## Community Support
114+
[MATLAB Central](https://www.mathworks.com/matlabcentral)
115+
116+
Copyright 2023-2024 The MathWorks, Inc.

codecov.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ignore:
2+
- "**/*.test"
3+
fixes:
4+
- "\\+opentelemetry/\\+sdk/\\+trace/::sdk/trace/+opentelemetry/+sdk/+trace/"
5+
- "\\+opentelemetry/\\+sdk/\\+metrics/::sdk/metrics/+opentelemetry/+sdk/+metrics/"
6+
- "\\+opentelemetry/\\+sdk/\\+common/::sdk/common/+opentelemetry/+sdk/+common/"
7+
- "\\+opentelemetry/\\+trace/::api/trace/+opentelemetry/+trace/"
8+
- "\\+opentelemetry/\\+metrics/::api/metrics/+opentelemetry/+metrics/"
9+
- "\\+opentelemetry/\\+context/::api/context/+opentelemetry/+context/"
10+
- "\\+opentelemetry/\\+common/::api/common/+opentelemetry/+common/"
11+
- "\\+opentelemetry/\\+baggage/::api/baggage/+opentelemetry/+baggage/"
12+
- "\\+opentelemetry/\\+exporters/\\+otlp/::exporters/otlp/+opentelemetry/+exporters/+otlp/"
13+
- "\\+opentelemetry/\\+sdk/\\+logs::sdk/logs/+opentelemetry/+sdk/+logs/"
14+
- "\\+opentelemetry/\\+logs/::api/logs/+opentelemetry/+logs/"

0 commit comments

Comments
 (0)