Shutting down a MeterProvider with a asynchronous instrument can take a long time
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- matlab
- Domain
- observability-sre, testing-qa
Research direction
Start by running the supplied MATLAB loop and compare shutdown timing for the observable gauge and synchronous counter. Inspect the MeterProvider creation and opentelemetry.sdk.common.Cleanup.shutdown path, then review the asynchronous example in test/texamples.m. Done means asynchronous shutdown no longer intermittently takes about 30 seconds and the example test no longer needs filtering.
Written by the indexing model from the issue text.
Description
Run the following code in a loop. Many iterations take only about 0.01 seconds to run but some can take a long time (~30 seconds).
function out = currentsecond()
% callback function for an observable gauge
dt = datetime("now");
s = second(dt);
out = opentelemetry.metrics.ObservableResult;
out = out.observe(s);
for i=1:10,
mp = opentelemetry.sdk.metrics.MeterProvider();
opentelemetry.metrics.Provider.setMeterProvider(mp);
clear
mp = opentelemetry.metrics.Provider.getMeterProvider();
m = getMeter(mp, "foo");
g = createObservableGauge(m, @currentsecond, "bar");
tic;
opentelemetry.sdk.common.Cleanup.shutdown(mp);
toc;
end
In comparison, if the code is changed to create a synchronous instrument (e.g. counter) instead of an asynchronous one, then shutdown never takes a long time, always around 0.01 seconds.
This issue causes an asynchronous example test in test/texamples.m to be filtered out due to the time it takes to run the test.
- Dominant language
- MATLAB
- Stars
- 19
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mathworks/OpenTelemetry-MATLAB
-
documentation
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
documentation
mathworks/OpenTelemetry-MATLAB#248 · 1 assignee ·
-
test
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
otel-cpp changes
Difficulty 3/5 1-2 days Newbie friendliness 42/100
-
enhancement
mathworks/OpenTelemetry-MATLAB#242 · 1 comment · 1 assignee ·
All issues in mathworks/OpenTelemetry-MATLAB
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Documentation Good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
flatironinstitute/numbl#65 ·
-
Component: Continuous Integration Component: MATLAB Type: enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
VH-Lab/NDIcalc-vis-matlab#107 ·