The current plan is to have a metrics-only agent run in the slave
server. It
will write a file indicating what its jmx exporter endpoint is. The host
agent will probe a directory where the slave agents write their files - when
new files are discovered, the agent will change its resource configuration
"Metrics Endpoint" thus triggering an inventory update. When the server sees
this update, it will write out new P scrape endpoint configs so P knows to
scrape the slave endpoints, too.
I think I have domain mode working; at least, things look sane in the inventory UI and
Prometheus.
https://github.com/hawkular/hawkular-commons/pull/202
https://github.com/hawkular/hawkular-agent/pull/423
If you build with those, then build hawkular-services with commons and agent SNAPSHOT deps
(to pick up the new stuff), you should be able to see it working.
Run your new h-services build and prometheus from within your h-services directory:
hawkular-services/dist/target/hawkular-services-dist-1.0.0.Final-SNAPSHOT/bin/standalone.sh
-b 0.0.0.0 -Dhawkular.agent.enabled=false
hawkular-services/dist/src/test/scripts/run-prometheus.sh
Then run a wildfly+agent in domain mode - your h-agent directory has a distro that mvn
builds so that you can test. I run it on another box so my ports don't conflict with
the h-services server:
cd
hawkular-agent/hawkular-javaagent-wildfly-dist/target/hawkular-javaagent-wildfly-dist-2.0.0.Alpha1-SNAPSHOT/bin
export HAWKULAR_USER=jdoe
export HAWKULAR_PASSWORD=password
./domain.sh --host-config=host-hawkular.xml
-Dhawkular.rest.url=http://your-h-services-server:8080
-Dhawkular.agent.metrics.host=your-local-host
Then just go to the inventory UI and poke around.
I'm sure there are things still not right (missing metrics, perhaps) but I suspect the
rest of the work is just getting the inventory and metric configuration files to match
what we want to collect.