matlab-instrument-opentelemetry-tracing
Add OpenTelemetry tracing to MATLAB code. Use when the user asks to "add tracing", "instrument with spans", "add OpenTelemetry", "trace my code", "add observability" (when about tracing), or mentions "spans", "distributed tracing", or "OTel tracing" in the context of MATLAB functions. Covers span creation, parent-child context propagation, error handling, attributes, events, and semantic conventions.
npx skills add matlab/matlab-agentic-toolkit --skill matlab-instrument-opentelemetry-tracing --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Instrument MATLAB Code with OpenTelemetry Tracing Add OpenTelemetry tracing spans to MATLAB functions with correct implicit context propagation, RAII lifecycle, and semantic conventions. ## Prerequisites The [OpenTelemetry-MATLAB](https://www.mathworks.com/matlabcentral/fileexchange/130979-opentelemetry-matlab) package (Version 1.11.0 or newer) must be installed. It provides the `opentelemetry.trace.*` namespace used throughout this skill. Requires MATLAB R2022b or newer. ## Key Functions | Function | Purpose | Toolbox | Available From | |----------|---------|---------|----------------| | `opentelemetry.trace.getTracer` | Obtain a tracer instance by name | OpenTelemetry-MATLAB | R2022b | | `startSpan` | Create a new span from a tracer | OpenTelemetry-MATLAB | R2022b | | `makeCurrent` | Set span as current context (enables implicit parent-child) | OpenTelemetry-MATLAB | R2022b | | `setAttributes` | Attach key-value metadata to a span | OpenTelemetry-MATLAB | R2022b | | `setStatus` | Mark span as "Ok" or "Error" | OpenTelemetry-MATLAB | R2022b | | `recordException` | Record an MException on a span | OpenTelemetry-MATLAB | R2022b | | `addEvent` | Record a timestamped event within a
- Prerequisites
- Key Functions
- MATLAB API Differences
- When to Use
- When NOT to Use
- Absolute Rules
- 1. Never modify function signatures
- 2. Spans are RAII — never call endSpan at function exit
- 3. Scope is RAII — never call clear(scope) at function exit
- 4. Always call makeCurrent on every span
- 5. Never pass explicit "Context" to startSpan
- 6. Always set span status
- 7. Use getTracer directly
- 8. Use snakecase attribute names with meaningful domain nouns
What does the matlab-instrument-opentelemetry-tracing skill do?
Add OpenTelemetry tracing to MATLAB code. Use when the user asks to "add tracing", "instrument with spans", "add OpenTelemetry", "trace my code", "add observability" (when about tracing), or mentions "spans", "distributed tracing", or "OTel tracing" in the context of MATLAB functions. Covers span creation, parent-child context propagation, error handling, attributes, events, and semantic conventions.
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-instrument-opentelemetry-tracing --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
