Skip to content
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

Expose ThreadPoolTaskExecutor queue size and capacity for metrics #28583

Closed
wants to merge 1 commit into from

Conversation

rguihard
Copy link
Contributor

@rguihard rguihard commented Jun 8, 2022

We're using grafana to monitor our app through java jmx exporter. We planned to configure some alerts based on those metrics, and we think it could be interesting to have at least the currentQueueCapacity for this purpose since the queue size directly affects the app memory load.
(Having the queueCapacity seems also interesting to set up triggers whose trigger value are calculated based on the maximum capacity of the queue.)

We're using grafana to monitor our app through java jmx exporter. We planned to configure some alerts based on those metrics, and we think it could be interesting to have at least the currentQueueCapacity for this purpose  since the queue size directly affects the app memory load.
(Having the queueCapacity seems also interesting to set up triggers whose trigger value are calculated based on the maximum capacity of the queue.)
@pivotal-cla
Copy link

@rguihard Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 8, 2022
@pivotal-cla
Copy link

@rguihard Thank you for signing the Contributor License Agreement!

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 8, 2022
@sbrannen sbrannen self-assigned this Jun 8, 2022
@sbrannen sbrannen added this to the 5.3.21 milestone Jun 8, 2022
@sbrannen sbrannen changed the title Expose ThreadPoolTaskExecutor metrics to JMX Expose ThreadPoolTaskExecutor queue size and capacity for metrics Jun 8, 2022
sbrannen pushed a commit that referenced this pull request Jun 8, 2022
We use Grafana to monitor our app via Spring's JMX exporter, and we
think it could be interesting to have at least the current queue size
for this purpose since the queue size directly affects the app memory
load. Having the queue capacity seems also interesting to set up
triggers whose values are calculated based on the maximum capacity of
the queue.

This commit introduces new getCurrentQueueSize() and getQueueCapacity()
methods in ThreadPoolTaskExecutor.

See gh-28583
@sbrannen sbrannen closed this in 8478e8e Jun 8, 2022
@sbrannen
Copy link
Member

sbrannen commented Jun 8, 2022

This has been merged into 5.3.x and main in e386bdb and revised in 8478e8e.

Note that there were build failures due to Checkstyle violations. I fixed those for you, but please make sure to run ./gradlew check before pushing commits in the future to ensure that the build passes.

Thanks for contributing your first PR to the Spring Framework! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants