I’d say look around for telemetry libraries in Elixir. Here’s one recent blog article on the topic: https://samuelmullen.com/articles/the-hows-whats-and-whys-of-elixir-telemetry/
Link to a YouTube talk through this forum: 21) ElixirConf EU 2019 - Telemetry ...and metrics for all - Arkadiusz Gil
Additionally, there has been a discussion and plans on centralising the telemetry solutions in Elixir space here: OpenCensus gains new integrations with Elixir libraries
Sorry I can’t be more helpful, I am rather new to the topic myself and only recently started gathering some education material. But I think telemetry / logging is going to be your best bet – unless somebody else had that exact problems and chimes in with a solution.