OpenTelemetry tracing of Dbus calls

Ralf Habacker ralf.habacker at freenet.de
Thu Jan 12 10:57:26 UTC 2023


Am 30.11.22 um 08:53 schrieb Umut Tezduyar Lindskog:
> PIs. Is there a way to hook in lttng or eBPF to dbus protocol (or to the 
> daemon) and convert their signals to OpenTelemetry traces?

Currently this is not available by default, you need to patch the dbus 
sources to add the appropriate support.

There is a verbose mode for the dbus client library and server that 
issues a large set of internal function calls and processing steps, 
implemented by a call to the `dbus_verbose(..)` macro with a printf like 
parameter list. With autotools build system this is enabled by adding 
--enable-verbose-mode to the configure command line. Please note that 
this switch is normally not set on production releases of dbus, because 
it will slow done processing.

To extend dbus with lttng support, the first step could be to replace 
this function with corresponding lttng calls, e.g. 
[lttng_ust_tracef]https://lttng.org/docs/v2.13/#doc-tracef. However, 
this only passes strings that would have to be filtered appropriately 
for classifications.

Since dbus is usually integrated in other applications and/or interacts 
with other applications, what I personally find interesting about the 
approach with lltng is the possibility of being able to get synchronized 
traces across multiple applications including the kernel, which can help 
with complex problems that arise from time to time. Otherwise, one must 
compile non-synchronized logs of the individual applications in time, 
which is not easy.

Ralf


More information about the dbus mailing list