Skip to content

Initial no-op plumbing for BEAM (Erlang/Elixir) support#958

Merged
christos68k merged 10 commits into
open-telemetry:mainfrom
GregMefford:beam_plumbing
Nov 18, 2025
Merged

Initial no-op plumbing for BEAM (Erlang/Elixir) support#958
christos68k merged 10 commits into
open-telemetry:mainfrom
GregMefford:beam_plumbing

Conversation

@GregMefford
Copy link
Copy Markdown
Contributor

@GregMefford GregMefford commented Nov 12, 2025

Now that I've spiked out the proof-of-concept solution in #289, the purpose of this PR is to split out most of the mundane details so that it will hopefully be much easier to review and merge incrementally.

In this PR, I am just setting up the required types, structs, and plumbing to get the agent to identify BEAM processes and attach to them, sending back a single minimal stack frame to demonstrate that it's alive, without really doing anything more.

Here is an example of what those single-depth no-op stack frames look like in devfiler, by comparison to what's in the other PR discussion thread:
image

I am hoping that this is an acceptable strategy for getting things merged incrementally, or that we can come up with some way to make it safe-enough to merge by disabling something, since this part is pretty routine and about the same as the other interpreters. Then, it'll be much easier to focus on what's needed to get the actual unwinder code working smoothly, without having to deal with merge conflicts and other tedious changes at the same time.

I could potentially trim things down even more (for example, just print a message and return an error when I identify a BEAM process), but I thought this is the minimal path through the entire code, so it's more valuable to confirm that the unwinder code actually is called even if it's not doing anything useful.

@GregMefford GregMefford requested review from a team as code owners November 12, 2025 02:28
Copy link
Copy Markdown
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing the work, will do another pass!

Comment thread tools/coredump/testsources/beam/plug_app.exs
Comment thread interpreter/beam/beam.go Outdated
Comment thread interpreter/beam/beam.go Outdated
Comment thread support/ebpf/beam_tracer.ebpf.c Outdated
@GregMefford GregMefford force-pushed the beam_plumbing branch 2 times, most recently from 6d8c00a to 533aa36 Compare November 15, 2025 03:24
Copy link
Copy Markdown
Contributor

@fabled fabled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM mostly. Regex needs fixup and some nits. Also I merged just #749 so this likely needs a rebase. Please also build and include the ebpf tracer binaries (docker run -it --mount "type=bind,src=$PWD,dst=/data" --rm otel/opentelemetry-ebpf-profiler-dev:latest "make amd64 arm64 -C /data/support/ebpf"). Currently the ebpf binaries are needed in Git so that ebpf-profiler can be just included in other projects without manual compilation steps.

Comment thread interpreter/beam/beam.go Outdated
Comment thread support/ebpf/extmaps.h Outdated
Comment thread support/types_def.go Outdated
@GregMefford
Copy link
Copy Markdown
Contributor Author

I think I got your feedback addressed. Thanks for the handy command to rebuild the ebpf code for both architectures! I didn't realize it was that simple, so I was building it once on my M1 mac in a linux VM and once on a physical x86 linux box, which was pretty tedious. ❤️

Copy link
Copy Markdown
Contributor

@fabled fabled left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just missing the String for interpreter data. But approving at this time. Thanks!

Comment thread interpreter/beam/beam.go
Comment thread support/ebpf/beam_tracer.ebpf.c
Copy link
Copy Markdown
Member

@christos68k christos68k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few more nits, can you also rebase on top of main and fix merge conflicts? Then I can merge.

Comment thread interpreter/beam/beam.go Outdated
Comment thread support/ebpf/beam_tracer.ebpf.c
@GregMefford
Copy link
Copy Markdown
Contributor Author

Thanks again for the feedback! I think it should be all squared up now.

@christos68k christos68k merged commit 77e078d into open-telemetry:main Nov 18, 2025
28 checks passed
@GregMefford GregMefford deleted the beam_plumbing branch December 7, 2025 23:11
florianl added a commit that referenced this pull request Jan 15, 2026
With #958 @GregMefford added the support of Erlang as HLL.
florianl added a commit that referenced this pull request Jan 21, 2026
With #958 @GregMefford added the support of Erlang as HLL.

Signed-off-by: Florian Lehner <florian.lehner@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants