-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor.queued
metrics of ForkJoinPool does not include queued submissions
#5650
Comments
Thank you for the report. I suspect it was an oversight that |
executor.queued
metrics of ForkJoinPool should include queued submissionsexecutor.queued
metrics of ForkJoinPool does not include queued submissions
I think so, yes. At least from my point of view it doesn't make much difference if an item is in a worker thread queue or if it is still just a "submission". I am not at all sure that there is a need to have separate metrics for tasks vs submissions. I think I'd opt to just summarise them and keep the |
If we could go back in time and do it properly, I think it would be best to use Currently
ProposalsPutting some proposals down for discussion. 1
This won't break any queries/dashboards per se, but it does change the meaning of the metric, and previously set alert thresholds may not be appropriate after this change. It can be hard for users to be aware of such a change in meaning of the metric, so it may surprise some users, even though many/most may be unaffected. 2(We can further discuss the tag name/value if we go with this proposal; I'm just putting something down for now to show the idea) Depending on the metrics backend and how the query is written, this could have a similar effect to proposal 1, while making it possible to query the same info as before. It would help to get some feedback on what kind of queries on this metric users are currently using to know the impact. As @tommyk-gears pointed out, this would be a departure from how the metric 3
This leaves the existing metric unchanged, which will not break any users while introducing two new metrics that can be used separately or summed. The duplication of two metrics with the same meaning is wasteful and unfortunate, but that's the cost of making the change completely backward compatible. An alternative to this proposal may be to make a new single metric name that differentiates the two values by tag. |
@jonatan-ivanov and I discussed this today. I think the approach we'd like to take is to treat |
@tommyk-gears given your previous feedback that you don't think you'd have a need to monitor them separately, I think we'll hold off on such an enhancement until a user asks for it. Thoughts? |
I am perfectly fine with the solution you've already provided ( |
Please describe the feature request.
A clear and concise description of what you would like to be able to do with Micrometer and cannot currently.
In
io.micrometer.core.instrument.binder.jvm.ExecutorServiceMetrics#monitor(io.micrometer.core.instrument.MeterRegistry, java.util.concurrent.ForkJoinPool)
theexecutor.queued
metrics is bound toForkJoinPool::getQueuedTaskCount
.The javadoc for
ForkJoinPool::getQueuedTaskCount
states:Now, in ForkJoinPool there is aslo
getQueuedSubmissionCount()
with this javadoc;The current bindings completely ignores the
getQueuedSubmissionCount()
. One solution might be to just bindexecutor.queued
to the sum ofgetQueuedTaskCount()
andgetQueuedSubmissionCount()
. Another solution might be to have them both bound toexecutor.queued
but with different additional tags (but that might be considered a breaking change, and align badly with metrics on other types of ExecutorServices?).Rationale
In my opinion it is more interesting to monitor the queued submissions than the queued tasks (in ForkJoinPool terminology) since when the pool threads are not able to keep up with the submission, they will pile up in queued submissions (but the number of queued tasks remain at 0 in my experience).
The text was updated successfully, but these errors were encountered: