ForgeOpsTracker.EventBuilder (forge_ops_tracker v0.1.0)

Copy Markdown View Source

Turns an exception/reason plus an Elixir stacktrace into the payload shape the ingestion API expects. Unlike the Ruby/PHP/JS clients in this repo, backtrace parsing here is not a regex over a string -- __STACKTRACE__ is already a structured list of {module, function, arity, location} tuples (location a keyword list with :file/:line), the same situation Python's traceback module and Java's Throwable.getStackTrace() put those clients in. Verified directly against a real raised-and-rescued exception's __STACKTRACE__ before relying on this shape, not assumed from documentation alone.

Summary

Functions

reason is whatever was raised/thrown -- typically an Exception struct, but Elixir permits raising any term, so this doesn't require one. stacktrace is __STACKTRACE__ as captured at the rescue/catch site. context is an arbitrary map of additional data to attach.

Functions

build(config, reason, stacktrace, context \\ %{})

reason is whatever was raised/thrown -- typically an Exception struct, but Elixir permits raising any term, so this doesn't require one. stacktrace is __STACKTRACE__ as captured at the rescue/catch site. context is an arbitrary map of additional data to attach.