a module for self-monitoring of WildFly was the goal of the diploma
thesis by Vojtech Schlemmer.
I know that in the meantime, Heiko created a submodule for the same purpose.
Still, it could be worth looking at Vojtech's result:
For docs see the text of the thesis (in English), for working configured
server download the Appendix.
It is configurable through CLI (what to monitor, interval of each
monitored metric, aggregation).
One distinctive feature is storing into a database using WildFly's
datasource (IIRC the other doesn't have it).
Copy on GitHub: https://github.com/OndraZizka/wildfly-selfmonitor
It's a rough prototype, so the implementation of some features is really
basic and, so to say, not optimal.