Goanna
Yet another erlang tracing library.
Install / Use
/learn @ruanpienaar/GoannaREADME
Goanna Cluster tracing library
_.-~~-.__
_-~ _-=-_ ''-,,
('___ ~~~ 0 ~''-_,,,,,,,,,,,,,,,,
\~~~~~~--' '''''''--,,,,
~`-,_ () '''',,,
'-,_ \ / '', _~/|
,. \||/~--\ \_________ / /______...---. ; /
\ ~~~~~~~~~~~~~ \ )~~------~`~~~~~~~~~~~( /---- /,'/ /
| - / / \ \ /;/ /
/ - / / / \ /;/ / -.
/ __.---/ \__ /, /| |:| \ \
/_.~`-----~ \. \ ~~~~~~~~~~~~~---~`---\\\\ \---__ \:\ / /
`\\\` ' \\' ' --\'\, / /
'\, ~-_'''"
Getting started
Docker container
docker pull ruanpienaar/goanna
From Source
Get It and compile it
$ git clone https://github.com/ruanpienaar/goanna && cd goanna && make
!Important
ets:take is not present in erlang 17 and lower. remove the macro 'ETS_TAKE' from rebar.config if you're on 17, and recompile.
Description
Goanna is a small library built on top of dbg, primarily for convenience.
goanna allows you to easily specify nodes either in the command line, or in the sys.config. Goanna uses hawk for managing remote node connectivity. Hawk will try and reconnect nodes that have disconnected and re-apply previous traces. This is useful in testing/debugging scenarios where the nodes are ephemeral or short lived due to an issue. Hawk will Only work with OTP Erlang versions with map support, and therefore, the same for goanna.
Beam shell example:
1> goanna_api:add_node('somenode@some.host', oreo).
System config example:
{goanna,[
{nodes,[
{NodeName, Cookig} %% 'somenode@myhost.com', oreo
]}
]}
So once you've added some nodes, you can enable a trace pattern with (Module), (Module, Function), (Module, Function, Arity) or write your own trace match spec as a String ("ets:lookup(Cust, customers) when Cust==homer -> return"), with help of redbug's string parsing to dbg trace match spec code.
Tracing Example:
1> goanna_api:trace(module).
2> goanna_api:trace(module, function).
3> goanna_api:trace(module, function, 1).
4> goanna_api:trace_ms("ets:lookup(Cust, customers) when Cust==homer -> return").
Goanna Forward Callback Mod
-behaviour(goanna_forward_callback_mod).
You can write your own trace entry handler callback module. Just follow the goanna_forward_callback_mod behaviour convention, and do whatever you like with trace entries. There are examples in src/, goanna_forward_shell and goanna_forward_file. Choose your forward module and have data_retrival_method set to push as explained in the sys.config below.
Sys.config options
Goanna features a host of different config options to be set as defaults or can be adjust at runtime. One of config settings deals with limiting traces by either a timed limit or trace message count limit or whichever comes first.
Application env System configuration options:
- data_retrival_method ( push or pull )
{push, WaitTime :: non_neg_integer(), GoannaForwardCallbackModule :: atom(), BatchAmount :: atom()}
|
pull
- nodes ( Nodes to connect to on startup )
[{Node :: atom(), Cookie :: atom()}]
- traces ( Traces to be applied on startup )
[{Module :: atom()}],
[{Module :: atom(), Function :: atom()}],
[{Module :: atom(), Function :: atom(), Arity :: non_neg_integer()}]
- default_trace_options ( Options regarding running traces, like time and trace message total count )
{time, TimeMs :: non_neg_integer()}
{messages, Messages :: non_neg_integer()}
WIP Roadmap
- custom trace_port client
- file trace needs to be implemented ( trace to binary file format, faster )
- able to have multiple forward callback modules.
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
