This is an example gist showing how to instrument a tomcat server with Traceview inside an apline linux docker container.
####Running the tracelyzer outside the container When you run the tracelyzer on the host instead of the container you need to do two things
- Set the address to report to via the environment variable
TRACEVIEW_UDPADDR
this can be done in the Dockerfile or set at runtime. - You need to share the following volume between the host where the tracelyzer is running and the container
/var/lib/tracelyzer
Example:docker run -e "TRACEVIEW_UDPADDR=127.0.0.1" -v /var/lib/tracelyzer:/var/lib/tracelyzer dockerimage
Lastly you need to make the tracelyzer on the host listen on all interfaces: Debian-based: edit /etc/default/tracelyzer and update/add LISTEN_HOST=0.0.0.0 Redhat-based: edit /etc/sysconfig/tracelyzer and update/add LISTEN_HOST=0.0.0.0 (restart tracelyzer after changing)
####App Config App config is handled automatically via an API call inside setenv.sh, the site key needs to be added (without <>) and the other parameters can be alterred. Tomcat automatically runs setenv.sh from within catalina.sh, this may need to be alterred depending on your environment.