[lttng-dev] Tracing a docker containerized java application from the host

Jérémie Galarneau jgalar at efficios.com
Thu Mar 16 12:14:14 EDT 2023


Hi Adel,

The java tracing facilities make use of an agent that communicates with the session deamon through a TCP socket. You must to ensure your java application can connect to the session daemon's 'agent-tcp-port'.

https://lttng.org/man/8/lttng-sessiond/v2.13/#doc-opt--agent-tcp-port

Is that port properly exposed by your container configuration?

Jérémie

--
Jérémie Galarneau
EfficiOS Inc.
https://www.efficios.com
________________________________
From: lttng-dev <lttng-dev-bounces at lists.lttng.org> on behalf of Adel Belkhiri via lttng-dev <lttng-dev at lists.lttng.org>
Sent: March 15, 2023 20:03
To: lttng-dev at lists.lttng.org <lttng-dev at lists.lttng.org>
Subject: [lttng-dev] Tracing a docker containerized java application from the host

Hello everyone,

I am reaching out to seek assistance in tracing an instrumented Java application running within a Docker container from the host side.

In my setup, the LTTng session daemon, running on the host side, indicates that application registration has been completed (please refer to the logs). However, when running the command "lttng list --jul," no registered applications are displayed. Although the application successfully creates the "LttngLogHandler" object and attaches it to the logger, no traces are generated.

To allow the application to access the lttng socket file, the host's /var/run/lttng directory is shared with the container at launch (using the command "sudo docker run -p 8080:8080 -v /var/run/lttng:/var/run/lttng sample-image"). I am only interested in collecting userspace Java (--jul) traces.

I would greatly appreciate any assistance or guidance that you can provide. Thank you for your time.

Additional details include:

Ubuntu 22.04
Kernel: 5.15.0-60-generic
LTTng session daemon version: 2.13.2
Docker version 20.10.21, build 20.10.21-0ubuntu1~22.04.2
Regards,
Adel Belkhiri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20230316/7819d725/attachment.htm>


More information about the lttng-dev mailing list