-
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
Rework Jetty ThreadPool metrics to work with any ThreadPool #911
Comments
@wilkinsona |
It’s set via the customizers. As I said, it’s a pain, but it’s the best way we have at the moment. |
@wilkinsona Thanks for the quick feedback! I saw it but expected the |
Yes. The customizer beans are created and called very early in the lifecycle. See these tests that verify the behaviour. |
@wilkinsona Ah, sorry. I didn't know. I'll look into it to understand how. |
This commit confirms WebServerFactoryCustomizer's execution precedes other bean creations. See micrometer-metrics/micrometer#911
This commit confirms EmbeddedServletContainerCustomizer's execution precedes other bean creations. See micrometer-metrics/micrometer#911
I didn't look into it yet but as @wilkinsona explained (Thanks, again), I confirmed that customizer's execution precedes other bean creations in I tried to resolve this issue in izeye@925ea22 as @wilkinsona suggested but broke the existing tests having @wilkinsona Could you look into it? |
I can’t see a test in izeye@925ea22. Have I missed it or did you mean to reference a different commit? |
@wilkinsona Sorry, I fixed the wrong link in the comment right away but I guess you've checked it in your email. See izeye/sample-micrometer-spring-boot@5f3ac5a |
Yeah, that was it. Thanks. The problem is that your test is using a mock web environment so the embedded container isn't involved. You need to configure it to use a random or defined port at which point your customiser will be called and I think this may show a problem with the approach. In the Tomcat case, a |
@wilkinsona Thanks for the explanation 👍 I just added I created #914 with it to resolve this and for easier discussion if necessary. |
This has been discussed on #593, but I don't want it to get lost in the push to RC1 as it's important for Boot 2.1 as well.
The short of it is that I think the class that binds the metrics for Jetty's thread pool should be reworked so that it doesn't rely on being able to customise the
ThreadPool
of theServer
. Such customisation may overwrite something that a user's already done.I think the
MeterBinder
should look something like this:Getting hold of the
Server
needed to createJettyThreadPoolMetrics
is a pain and is something we should improve in Boot. It can be done like this with Boot 2:I believe a similar approach should work with Spring Boot 1.
The text was updated successfully, but these errors were encountered: