File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
api/trace/+opentelemetry/+trace
test/autotrace_examples/manual_instrumented_example Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 1+ function sp = getCurrentSpan()
2+ % Retrieve the current span
3+ % SP = OPENTELEMETRY.TRACE.GETCURRENTSPAN() returns the current span.
4+ % If there is not current span, SP will be an invalid span with all-zero
5+ % trace and span IDs.
6+ %
7+ % See also OPENTELEMETRY.TRACE.SPAN,
8+ % OPENTELEMETRY.CONTEXT.GETCURRENTCONTEXT
9+ % OPENTELEMETRY.TRACE.CONTEXT.EXTRACTSPAN
10+
11+ % Copyright 2024 The MathWorks, Inc.
12+
13+ ctx = opentelemetry .context .getCurrentContext ;
14+ sp = opentelemetry .trace .Context .extractSpan(ctx );
Original file line number Diff line number Diff line change 55% Copyright 2024 The MathWorks, Inc.
66
77% add an attribute about input
8- ctx = opentelemetry .context .getCurrentContext ;
9- sp = opentelemetry .trace .Context .extractSpan(ctx );
8+ sp = opentelemetry .trace .getCurrentSpan ;
109setAttributes(sp , " DataSize" , n );
1110
1211[x , y ] = generate_data(n );
You can’t perform that action at this time.
0 commit comments