MCPcopy Index your code
hub / github.com/elastic/devfiler

github.com/elastic/devfiler @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
302 symbols 589 edges 34 files 91 documented · 30%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

devfiler

devfiler reimplements the whole collection, data storage, symbolization, and UI portion of OTel eBPF Profiler in a desktop application. This essentially allows developers to start using the profiling agent in a matter of seconds without having to spin up a whole Elastic deployment first.

devfiler currently supports running on macOS and Linux. Note that this doesn't mean that this application can profile macOS applications: the OTel eBPF Profiler still needs to run on a Linux machine, but the UI can be used on macOS.

[!NOTE]

This is currently not a supported product. It started out as @athre0z's personal project and was later transferred to the Elastic GitHub account because some people in the team liked the idea of having it to speed up some development workflows and prototyping. We're now releasing it under Apache-2.0 to help with OTLP Profiling development, devfiler is not a production-ready backend and should not be deployed as such.

screenshot1

screenshot2

Build

Nix

The primary build system is currently the Nix package manager. Once Nix is installed on the system, devfiler can be built with the following command:

nix --experimental-features 'flakes nix-command' build '.?submodules=1#'

The executable is placed in the Nix store and a symlink is created in the root of this directory. You can then run devfiler using:

result/bin/devfiler

Alternatively you can simply ask Nix to both build and run it for you:

nix --experimental-features 'flakes nix-command' run '.?submodules=1#'

The need to always pass the --experimental-features argument can be circumvented by putting

experimental-features = nix-command flakes

into ~/.config/nix/nix.conf.

Cargo

Alternatively it's also possible to build devfiler with just plain cargo. This currently doesn't allow generating a proper application bundle for macOS, but it's perfectly sufficient for development and local use. Cargo is typically best installed via rustup, but using cargo and rustc from your distribution repositories might work as well if it is recent enough.

Additionally, make sure that g++ (or clang), libclang and protoc are available on the system. The following should do the job for Debian and Ubuntu. The packages should also be available in the repositories of other distributions and also from MacPorts/Brew, but names may vary.

sudo apt install g++ libclang-dev protobuf-compiler libprotobuf-dev cmake

devfiler can then be built using:

# Update submodules only after cloning the repository or when the submodules change.
git submodule update --init --recursive

cargo build --release

The executable is placed in target/release/devfiler.

Adding traces

devfiler is listening for profiling agent connections on 0.0.0.0:11000. To ingest traces, use a recent version of the OTel eBPF profiler and then run it like this:

sudo ./ebpf-profiler -collection-agent=127.0.0.1:11000 -disable-tls

Profiling on remote hosts

A common use-case is to ssh into and run the profiling agent on a remote machine. The easiest way to set up the connection in this case is with a ssh reverse tunnel. Simply run devfiler locally and then connect to your remote machine like this:

ssh -R11000:localhost:11000 someuser@somehost

This will cause sshd to listen on port 11000 on the remote machine, forwarding all connections to port 11000 on the local machine. When you then run the profiling agent on the remote and point it to 127.0.0.1:11000, the connection will be forwarded to your local devfiler.

Developer mode

Some of the more internal tabs that are only relevant to developers are hidden by default. You can unveil them with a double click on the "devfiler" text in the top left.

Releases

Creating release artifacts locally

Update version in Cargo.toml for the package to the appropriate release version number

# On a linux machine, architecture doesn't matter as long as qemu binfmt is installed:
nix bundle --system aarch64-linux --inputs-from . --bundler 'github:ralismark/nix-appimage' '.?submodules=1#appImageWrapper' -L
nix bundle --system x86_64-linux  --inputs-from . --bundler 'github:ralismark/nix-appimage' '.?submodules=1#appImageWrapper' -L
# Resulting appimages are symlinked into CWD.

# On a ARM64 mac w/ Rosetta installed:
nix build -L '.?submodules=1#packages.aarch64-darwin.macAppZip' -j20
cp result/devfiler.zip devfiler-apple-silicon-mac.zip
nix build -L '.?submodules=1#packages.x86_64-darwin.macAppZip' -j20
cp result/devfiler.zip devfiler-intel-mac.zip

[!NOTE]

Binary releases are covered by multiple licenses (stemming from compiling and linking third-party library dependencies) and the user is responsible for reviewing these licenses and ensuring that license terms (e.g. redistribution and copyright attribution) are met.

Elastic does not provide devfiler binary releases.

Extension points exported contracts — how you extend this code

TableKey (Interface)
Type that can act as the key for a [`Table`]. Defines how a given type is to be converted into a raw byte array. The ch [5 …
src/storage/table.rs
TabWidget (Interface)
(no doc) [8 implementers]
src/ui/tabs/mod.rs
RawTable (Interface)
Raw, untyped database table.
src/storage/table.rs
Table (Interface)
Typed database table.
src/storage/table.rs

Core symbols most depended-on inside this repo

get
called by 45
src/storage/table.rs
iter
called by 27
src/storage/table.rs
insert
called by 15
src/storage/table.rs
get_or_create
called by 10
src/ui/cached.rs
time_range
called by 9
src/storage/tables/traceevents.rs
get
called by 9
src/storage/symdb/mod.rs
join
called by 8
src/symbolizer/mod.rs
into_raw
called by 7
src/storage/table.rs

Shape

Method 159
Class 64
Function 63
Enum 12
Interface 4

Languages

Rust100%

Modules by API surface

src/storage/table.rs39 symbols
src/ui/tabs/flamegraph.rs29 symbols
src/storage/symdb/mod.rs20 symbols
src/ui/tabs/top_funcs.rs19 symbols
src/symbolizer/mod.rs16 symbols
src/storage/rkyvtree.rs15 symbols
src/ui/tabs/grpclog.rs14 symbols
src/storage/tables/stacktraces.rs12 symbols
src/ui/tabs/trace_freq.rs11 symbols
src/ui/app.rs11 symbols
src/collector/otlp/service.rs11 symbols
src/ui/tabs/executables.rs10 symbols

For agents

$ claude mcp add devfiler \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact