-
Notifications
You must be signed in to change notification settings - Fork 20
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
Promagent on a standalone Tomcat shutdown issue #7
Comments
This sounds like a bug. It does not seem related to missing settings. The only thing that starts a thread is the built-in server https://github.com/fstab/promagent/blob/master/promagent-framework/promagent-internal/src/main/java/io/promagent/internal/BuiltInServer.java. If you start promagent without the |
Indeed, after starting without the port, the process shuts down gracefully. |
It would be interesting to see if a shutdown hook works. If you try this and it works, please open a pull request. Alternatively, there are other ways to expose the metrics (see https://github.com/fstab/promagent#exposing-metrics):
|
A yeah, ok, that's right. I blindly went with the javaagent approach some time ago and forgot all about those alternatives. Since i already use the JMX exporter for some other cases - on the same Tomcat app and thus already present - i'll first go with that one and try that path. The promagent.war approach like promising also, it fits the Catalina approach, and i'll definitely try that one also. About the shutdown hook; if i find the time i'll definitely try that one too. And if it's valuable, i'll open a pull request. Thanks for the help (and i'll confirm if those alternatives work for me) ! |
Hi,
I've visited several forums and could not find a similar issue (with javaagent in general that is).
I'm kinda stuck (in the last mile) for the moment ...
Some context and the issue:
I'm trying to use the 'promagent' instrumention in a standalone Tomcat context.
I've made an agent implementation based on your promagent-example. It's actually very similar to your 'ServletHook' -example. So it's affecting the Servlet and ServletFilter implementation.
I've provided this/my java agent on the Tomcat process (at startup) via the CATALINA_OPTS settings like this:
export CATALINA_OPTS=" $CATALINA_OPTS -javaagent:./promagent.jar=port=40111 "
Further:
The issue:
When execute a 'catalina.sh stop' to shutdown the app/service (again: with the CATALINA_OPS still in effect) ... :
02-Apr-2019 09:48:04.324 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
So:
the question is; how can a avoid this error and/or how to setup the promagent in a Tomcat standalone context.
P.S. & FYI:
Thank you for any pointers, help, ... !
Best regards,
Wim.
The text was updated successfully, but these errors were encountered: