Skip to content

AutoTrace fails when files of types other than .m and .mlx is involved #196

@duncanpo

Description

@duncanpo

The easiest way to reproduce this issue is to create a .mat data file. For example,

y = magic(3);
save mymat y` 

The following foo.m file loads the .mat file:

function foo
y = load("mymat.mat");

Creating an AutoTrace object on this function fails because of the .mat file:

Error using [matlab.lang.internal.registerCallbackForFile](matlab:matlab.lang.internal.introspective.errorDocCallback('matlab.lang.internal.registerCallbackForFile'))
Error: Operation not supported for the provided file
C:\Users\dpo\oteldemo\simulink_autotrace_bug\mymat.mat.

Specifying the .mat file in ExcludeFiles also fails:

>> at = opentelemetry.autoinstrument.AutoTrace(@foo, ExcludeFiles="mymat.mat")
Error using [opentelemetry.autoinstrument.AutoTrace>processFileInput](matlab:matlab.lang.internal.introspective.errorDocCallback('opentelemetry.autoinstrument.AutoTrace>processFileInput', 'C:\Users\dpo\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\MATLAB Interface to OpenTelemetry\+opentelemetry\+autoinstrument\AutoTrace.m', 178)) ([line 178](matlab: opentoline('C:\Users\dpo\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\MATLAB Interface to OpenTelemetry\+opentelemetry\+autoinstrument\AutoTrace.m',178,0)))
mymat.mat is not found or is not a
valid MATLAB file with a .m or .mlx extension.

This issue also applies if the MATLAB function loads a Simulink model, or interacts with MATLAB or Simulink file types other than .m and .mlx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions