NASA Mission Control Room Updated 4/23/17: AppSignal has exited BETA and Scout has released a BETA agent. You’re diving into Elixir and are getting close to releasing your first production Elixir app. How do you profile and monitor it in production? Below is a tour of what’s available in the Elixir ecosystem today. Note that many tools are Erlang-based, which you have access to via Elixir. Metric Collection Generic metric collection is the sensor array for your app: a counter for user signups here, collecting average call times for a critical HTTP call there, etc. These services assist with collecting and aggregating metrics and send the metrics off to another service (ex: Graphite, InfluxDB, Datadog, etc) for visualizations and alerting. Exometer Ulf Wiger and Magnus Feuer’s is the defacto Erlang instrumentation package. There are several parts to Exometer: Exometer : you can tell Exometer to update values and have Exometer run functions at intervals of your choosing to record values. Recording Metrics : raw metrics are stored in via ETFs in the Beam VM. Storing Metrics : metrics are aggregated then forwarded onto external systems like Graphite, AMNQ, or StatsD. Reporting Metrics The following story by provides a great overview of Exometer: Michael Schäfermeyer _As lots of engineers in the Elixir community I have a ruby background, using rails as my go-to MVC framework._medium.com Monitoring Phoenix Elixometer Pinterest’s is a light Elixir wrapper around Exometer that makes defining/updating metrics easier, plus has a nice annotation to easily time a function’s execution time: Elixometer @timed # Timing a function. The metric name will be [:timed, :function]# Key will be: prefix.dev.timers.timed.function@timed(key: "timed.function")def function_that_is_timed doOtherModule.slow_methodend BEAM Resource Usage There are several tools for monitoring the resource usage of the BEAM VM, which runs your Elixr and Erlang apps. BEAM feels more like an operating system versus a typical VM and the monitoring tools for it have the sophistication to match. Observer The default goto is : it’s likely already installed on your computer. Try launching Observer via iex: Observer iex(9)> :observer.start Observer can also connect to a remote system. Wombat A full-featured operations and maintenance framework, is commercial software available via Erlang Solutions. Wombat Recon is one of the modules in the Erlang Recon application. The module provides access to high-level resource usage information of the Beam VM. Recon For example: iex(11)> :recon.info(self) [meta: [registered_name: [],memory_used: [memory: 143208, message_queue_len: 4, heap_size: 10958,total_heap_size: 17730,garbage_collection: [max_heap_size: %{error_logger: true, kill: true,size: 0}, min_bin_vheap_size: 46422, min_heap_size: 233,... Application Monitoring Application performance monitoring (APM) services instrument your Elixir function calls and provide a breakdown of performance via transaction traces. Most APM tools are orientated around monitoring web requests vs. general performance monitoring. AppSignal AppSignal has an officially-supported for Elixir. app monitoring agent Scout At my day job, we’ve released an app monitoring agent for Elixir. . Learn more New Relic New Relic does not have an officially supported agent, but there are a couple of s available: community-developed agent New Relixir — the author of the module ( ) mentioned in a response that can trigger performance (memory & cpu) issues triggered by . His module addresses these issues. new_relic new_relic Roman Smirnov new_relixir newrelic-erlang : app monitoring is a magical form of monitoring: you get a lot with little work. However, making that magic happen does involve hooks into applications that can cause crashes. For that reason, I’d lean towards services that have official support and a team dedicated to keeping their monitoring agents updated. My take Tracing and Profiling Sometimes you need to walk through an application’s execution frame-by-frame to debug an issue. There are several tools that provide this for Erlang and Elixir apps. Recon Trace Part of the previously mentioned Recon application, is an Erlang module that allows for safe tracing of functions in a production environment. Recon Trace Tap is a thin Elixir wrapper around Recon Trace, providing an easy Elixir interface to Recon Trace: Tap iex(1)> require Tapniliex(2)> Tap.call(String.strip(_, _), max: 4)2iex(4)> String.strip("test", ?t)"es"21:52:36.972255 #PID<0.88.0> String.strip("test", 116)21:52:36.972711 #PID<0.88.0> String.strip/2 --> "es" Erlyberly provides a GUI interface for debugging and profiling Erlang and Elixir apps. In addition to tracing, Elyberly collections information on processes and memory usage. Not that Elyberly is not meant to trace production systems as it has no overload protection. Elyberly The folks at Plataformatec have a great . getting started guide for Elyberly Redbug is a production-safe debugging/tracing utility for Erlang. Roberto Aloi has a great on his blog. Redbug Redbug tutorial DBG is an Erlang module for tracing. There’s also a thin Elixir wrapper around DBG called… . DBG DBG Exception Monitoring Many of the existing exception monitoring services already support Elixir. Elixir and Erlang have a unique take on exceptions, so it’s important to see how each service’s exception logic matches your needs. Some of the options: HoneyBadger Sentry Rollbar : I prefer services that use the language they monitor in production as they’ll have first-hand experience on its monitoring pains. in their own production apps. My take HoneyBadger has experience with Elixir