# Better Rust Observability We would like to improve the state of inspecting Rust projects at runtime. Currently, this fields is fractured and logs coherence. This is preferably done by reusing existing methods and libraries, but also with some substantial own development. Observability describes the ability to gather data about the runtime from a program, often to monitor its current behaviour. It can also be used during development though, e.g. for debugging. Our thesis is: all tasks to gather runtime information about programs often boil down to a base number of techniques and could be improved if the whole stack cares about such tasks. ## What to observe at runtime? * Business events, such as a new client arriving * High-level events, such as a task resuming or yielding, descheduled, etc. * Similar, for threads * Low-level events, such as function calls * Timing in-between events * Other system metrics, such as memory consumption, Stack depth, etc. * Location of events in the original source (often called source-to-object traceability) At development time, there's other metricts that are useful: * Code Coverage ## Common approaches * Logging/tracing (e.g. the rust tracing) * Sampling (e.g. perf) In general, these may happen either: * Through source code annotations (essentially manually) * Through platform facilities, such as dtrace, systemtap or perf * A mix of both, often through language frontend hacks (e.g. dtrace uses a special macro that inserts "dead" regions into a program that can be activated) Some of them are intended for live operation, others to be used during development. In the case of managed languages like Java and such, they become features of the runtime, in the case of runtimeless(ish) languages such things have an unclear place. This leads to a diffusion of responsibilities and island solutions. ## Suggested solutions * Unification of a fractured toolspace around Rust, but also about C/C++. * Easy to deploy on common platforms to allow for spread. * Easy integration in tools like rust-analyzer, clangd (perhaps through an LSP)