Skip to content

Commit 357f413

Browse files
authored
Add warning for parallel builds (#244)
* Add warning for parallel builds * Update warning message for parallel builds
1 parent 691bae5 commit 357f413

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

instrumentation/buildtool/+matlab/+buildtool/+plugins/OpenTelemetryPlugin.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55
methods(Access = protected)
66
function runBuild(plugin, pluginData)
7+
% Warn users that tasks on workers will not emit telemetry data
8+
% if a pool is open.
9+
%
10+
% Imperfect detection of parallel builds but
11+
% the impact of a false positive is very low
12+
p = gcp("nocreate");
13+
if ~isempty(p)
14+
warning("opentelemetry:buildtool:OpenTelemetryPlugin:NoParallelEmit", ...
15+
"Tasks executed on parallel workers do not emit telemetry data.");
16+
end
17+
718
% Configure by attaching to span if passed in via environment
819
% variable, and propagating baggage
920
configureOTel();
@@ -56,10 +67,6 @@ function runBuild(plugin, pluginData)
5667
end
5768

5869
function runTask(plugin, pluginData)
59-
% TODO:
60-
% - buildtool.task.outputs
61-
% - buildtool.task.inputs
62-
6370
% Definitions
6471
task = pluginData.TaskGraph.Tasks;
6572
taskName = pluginData.Name;
@@ -187,4 +194,4 @@ function cleanupOTel(span)
187194
otellp = opentelemetry.logs.Provider.getLoggerProvider;
188195
opentelemetry.sdk.common.Cleanup.forceFlush(otellp, timeout);
189196
opentelemetry.sdk.common.Cleanup.shutdown(otellp);
190-
end
197+
end

0 commit comments

Comments
 (0)