OpenTelemetry-MATLAB

版本 1.7.2 (18.8 MB) 作者: Duncan Po
MATLAB interface to OpenTelemetry
36.0 次下载
更新时间 2024/7/9

MATLAB Interface to OpenTelemetry

View OpenTelemetry-Matlab on File Exchange

MATLAB® interface to OpenTelemetry™, based on the OpenTelemetry Specification. 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.

Status

  • Tracing, metrics, and logs are all fully supported.
  • Supported and tested on Windows®, Linux®, and macOS.

MathWorks Products (https://www.mathworks.com)

Requires MATLAB release R2022b or newer

3rd Party Products:

Installation

Installation instructions

Installing With Toolbox Package

  1. Under "Assets" of a release, download the toolbox package .mltbx file.
  2. Start MATLAB.
  3. In the Current Folder browser, navigate to the .mltbx file.
  4. Right click on the .mltbx file and select "Install".

Building From Source

Before proceeding, ensure that the below products are installed:

  1. Download, Build and install OpenTelemetry MATLAB
cd <opentelemetry-matlab-root>
cmake -S . -B build -DCMAKE_INSTALL_PREFIX=<opentelemetry-matlab-installdir>
cmake --build build --config Release --target install

  1. Download OpenTelemetry Collector. You can just obtain a pre-built binary for your platform.

Getting Started

  1. Start OpenTelemetry Collector
otelcol --config <otelcol-config-yaml>
  1. Start MATLAB
  2. Add the OpenTelemetry MATLAB install directories to your MATLAB path
>> addpath <OpenTelemetry MATLAB installdir>

Examples

Tracing

  1. Create a default tracer provider and save it.
>> p = opentelemetry.sdk.trace.TracerProvider();
>> setTracerProvider(p);
  1. Start a span
>> tr = opentelemetry.trace.getTracer("My Tracer");
>> sp = tr.startSpan("My Span");
  1. End the span
>> sp.endSpan();
  1. If your collector is configured to display the data, you should see your span displayed.

Metrics

  1. Create a default meter provider and save it.
>> p = opentelemetry.sdk.metrics.MeterProvider();
>> setMeterProvider(p);
  1. Create a counter
>> m = opentelemetry.metrics.getMeter("My Meter");
>> c = m.createCounter("My Counter");
  1. Increment the counter
>> c.add(10);
  1. If your collector is configured to display the data, you should see your counter displayed after 1 minute.

Logs

  1. Create a default logger provider and save it.
>> p = opentelemetry.sdk.logs.LoggerProvider();
>> setLoggerProvider(p);
  1. Create a logger
>> l = opentelemetry.logs.getLogger("My Logger");
  1. Emit a log record with "info" level
>> info(l, "My Message");
  1. If your collector is configured to display the data, you should see your log record displayed.

For more examples, see the "examples" folder.

Help

To view documentation of individual function, type "help <function_name>". For example,

>> help opentelemetry.sdk.trace.TracerProvider

License

The license is available in the License file within this repository

Community Support

MATLAB Central

Copyright 2023-2024 The MathWorks, Inc.

引用格式

Duncan Po (2024). OpenTelemetry-MATLAB (https://github.com/mathworks/OpenTelemetry-MATLAB/releases/tag/1.7.2), GitHub. 检索来源 .

MATLAB 版本兼容性
创建方式 R2024a
与 R2022a 及更高版本兼容
平台兼容性
Windows macOS Linux
标签 添加标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

+libmexclass/+proxy

+opentelemetry/+baggage

+opentelemetry/+baggage/+propagation

+opentelemetry/+common

+opentelemetry/+context

+opentelemetry/+context/+propagation

+opentelemetry/+exporters/+otlp

+opentelemetry/+logs

+opentelemetry/+metrics

+opentelemetry/+sdk/+common

+opentelemetry/+sdk/+logs

+opentelemetry/+sdk/+metrics

+opentelemetry/+sdk/+trace

+opentelemetry/+trace

+opentelemetry/+trace/+propagation

版本 已发布 发行说明
1.7.2

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-MATLAB/releases/tag/1.7.2

1.7.1

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.7.1

1.7.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-MATLAB/releases/tag/v1.7.0
See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.7.0

1.6.1

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-MATLAB/releases/tag/v1.6.1

1.6.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.6.0

1.5.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.5.0

1.4.0.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.4.0

1.3.0.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.3.0

1.2.0.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.2.0

1.1.0.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.1.0

1.0.1.0

See release notes for this release on GitHub: https://github.com/mathworks/OpenTelemetry-Matlab/releases/tag/v1.0.1

1.0

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库