diff --git a/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m b/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m index f0a3a85..30730b8 100644 --- a/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m +++ b/instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m @@ -4,6 +4,17 @@ methods(Access = protected) function runBuild(plugin, pluginData) + % Warn users that tasks on workers will not emit telemetry data + % if a pool is open. + % + % Imperfect detection of parallel builds but + % the impact of a false positive is very low + p = gcp("nocreate"); + if ~isempty(p) + warning("opentelemetry:buildtool:OpenTelemetryPlugin:NoParallelEmit", ... + "Tasks executed on parallel workers do not emit telemetry data."); + end + % Configure by attaching to span if passed in via environment % variable, and propagating baggage configureOTel(); @@ -56,10 +67,6 @@ function runBuild(plugin, pluginData) end function runTask(plugin, pluginData) - % TODO: - % - buildtool.task.outputs - % - buildtool.task.inputs - % Definitions task = pluginData.TaskGraph.Tasks; taskName = pluginData.Name; @@ -187,4 +194,4 @@ function cleanupOTel(span) otellp = opentelemetry.logs.Provider.getLoggerProvider; opentelemetry.sdk.common.Cleanup.forceFlush(otellp, timeout); opentelemetry.sdk.common.Cleanup.shutdown(otellp); -end \ No newline at end of file +end