otel-profiling-agent icon indicating copy to clipboard operation
otel-profiling-agent copied to clipboard

flag to write traces to disk?

Open toumorokoshi opened this issue 10 months ago • 4 comments

Hello! I was wondering if it was possible to write the profile traces that are captured, and write those directly to disk?

I know that we can connect the profiler to a collector which could have an exporter to disk, but it would be nice to just write it directly from the profiler and avoid the network and serializations / deserialization overhead.

toumorokoshi avatar Feb 03 '25 19:02 toumorokoshi

Hello @toumorokoshi, we're moving towards having the profiling agent run as an OTel collector receiver. This means that instead of the current standalone profiling agent, users will deploy an OTel collector with the profiling agent receiver configured. So if one wants to write the traces to disk one can use an existing exporter (or implement a custom one) without network overhead.

The serialization overhead can't be avoided as traces will need to be serialized before written to disk.

christos68k avatar Feb 03 '25 19:02 christos68k

Interesting! Is there an issue I can follow along to watch that progress? moving the profiler into the collector would address my issue, definitely.

I'm less concerned about the overhead of serialization to disk (theoretically zero-copy data structures would make it possible to avoid it, but I know switching to that is unlikely). I was worried more about the cost of serialization of profile data from one process to the next.

toumorokoshi avatar Feb 03 '25 19:02 toumorokoshi

A lot of the work was done in #160, @dmathieu is currently working on an OTel collector distribution that includes the profiling receiver. You should also be able to build your own distribution.

christos68k avatar Feb 03 '25 19:02 christos68k

You can see a debug/demo distribution at https://github.com/dmathieu/tmp-profiles-collector/

dmathieu avatar Feb 03 '25 19:02 dmathieu

Closing this issue as with the fileexporter and the distribution demo @dmathieu shared it is possible to write data to file.

florianl avatar May 27 '25 12:05 florianl